.686p
.mmx
.model flat, c
option casemap :none

include main_type.inc
include main_data.inc
include main74_1.inc
include main74_2.inc
include main74_3.inc
include main74_4.inc
include main74_5.inc
include main74_6.inc
include main74_8.inc
include main74_9.inc
include main74_10.inc
include main74_11.inc
include c2asm.inc

.code


sub_43BCF0 proc	near			; CODE XREF: sub_42E970+1279p

var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 8
movsx	eax, word ptr word_7CAFF80
mov	edx, dword ptr newData3700h1_7BA8518
lea	ecx, [eax+eax*4]
lea	ecx, [eax+ecx*2]
lea	edx, [edx+ecx*4]
add	ecx, edx
xor	edx, edx
mov	dl, [ecx+20h]
mov	[esp+8+var_4], edx
xor	edx, edx
fild	[esp+8+var_4]
mov	dl, [ecx+21h]
mov	ecx, dword ptr dword_7CAFFB8
mov	[esp+8+var_8], edx
fmul	dword ptr flt_478710
test	ecx, ecx
fstp	[esp+8+var_4]
fild	[esp+8+var_8]
fmul	dword ptr flt_478710
fstp	[esp+8+var_8]
jle	short loc_43BD8B
fild	dword ptr dword_81C17B0
mov	ecx, dword ptr dword_7CAFF84
mov	edx, [esp+8+var_8]
fld	[esp+8+var_8]
fmul	dword ptr flt_4786E0
push	1				; int
push	ecx				; int
push	eax				; int
mov	eax, [esp+14h+var_4]
push	edx				; float
push	eax				; float
fsubp	st(1), st
push	ecx
fstp	[esp+20h+var_20]		; float
fild	dword ptr dword_81C17B4
fld	[esp+20h+var_4]
fmul	dword ptr flt_4786E0
push	ecx
fsubp	st(1), st
fstp	[esp+24h+var_24]		; float
call	sub_436060
add	esp, 1Ch

loc_43BD8B:				; CODE XREF: sub_43BCF0+51j
add	esp, 8
retn
sub_43BCF0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43BD90 proc	near			; CODE XREF: sub_451320+Ap
call	sub_44E1C0
mov	eax, dword ptr dword_7CC88DC
mov	byte_7C41CEE, 0
test	eax, eax
jz	short loc_43BDC2
mov	cl, byte_7CC7FFC
mov	edx, dword ptr dword_7CC6C70
push	ecx
push	eax
mov	eax, dword ptr dword_7CC6C74
push	edx
push	eax
call	sub_4322D0
add	esp, 10h

loc_43BDC2:				; CODE XREF: sub_43BD90+13j
mov	eax, dword ptr dword_47D430
cmp	eax, 0FFFFFFFFh
jz	short locret_43BDE3
mov	ecx, dword ptr dword_7CC6C70
mov	edx, dword ptr dword_7CC6C74
push	eax
push	ecx
push	edx
call	sub_4333E0
add	esp, 0Ch

locret_43BDE3:				; CODE XREF: sub_43BD90+3Aj
retn
sub_43BD90 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43BDF0 proc	near			; CODE XREF: sub_42C5F0+64Ep

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
mov	ecx, [esp+arg_0]
shl	eax, 8
add	eax, ecx
retn
sub_43BDF0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43BE00 proc	near			; CODE XREF: sub_40E2D0+2ECp
					; sub_40E2D0+30Cp ...

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_4]
mov	ecx, [esp+arg_0]
and	eax, 0FFh
and	ecx, 0FFh
shl	eax, 8
add	eax, ecx
retn
sub_43BE00 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43BE20 proc	near			; CODE XREF: sub_43C0C0+2p

var_4= dword ptr -4

push	ecx
push	ebx
push	esi
xor	ebx, ebx
xor	esi, esi

loc_43BE27:				; CODE XREF: sub_43BE20+48j
mov	byte_7ED99EC[esi], bl
mov	byte_7EC99EC[esi], 0FFh
mov	dword ptr g_alpha1[esi*4], ebx
call	_rand
and	eax, 80000003h
jns	short loc_43BE4C
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_43BE4C:				; CODE XREF: sub_43BE20+25j
mov	[esp+0Ch+var_4], eax
inc	esi
fild	[esp+0Ch+var_4]
cmp	esi, 10000h
fmul	dword ptr flt_478774
fstp	dword ptr flt_7F29A00[esi*4]
jl	short loc_43BE27
pop	esi
pop	ebx
pop	ecx
retn
sub_43BE20 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43BE70 proc	near			; CODE XREF: sub_43BEA0+8Cp
					; sub_43BEA0+168p
mov	eax, dword ptr g_hWnd1
push	0				; uType
push	0				; lpCaption
push	offset byte_7B7C9CC		; lpText
push	eax				; g_hWnd1
call	ds:MessageBoxA
mov	ecx, dword ptr g_hWnd1
push	0				; lParam
push	0				; wParam
push	2				; Msg
push	ecx				; g_hWnd1
call	ds:SendMessageA
retn
sub_43BE70 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43BEA0(char *)
sub_43BEA0 proc	near			; CODE XREF: sub_44BCE0+8Dp

var_103= byte ptr -103h
var_102= byte ptr -102h
var_101= byte ptr -101h
Text= byte ptr -100h
arg_0= dword ptr  4

sub	esp, 104h
push	esi
push	edi
mov	edi, [esp+10Ch+arg_0]
push	offset aRb			; "rb"
push	edi				; char *
call	_fopen
mov	esi, eax
add	esp, 8
test	esi, esi
jnz	short loc_43BF05
push	edi
lea	eax, [esp+110h+Text]
push	offset aSFileNotFound_		; "%s file not found."
push	eax				; char *
call	_sprintf
mov	edx, dword ptr g_hWnd1
add	esp, 0Ch
lea	ecx, [esp+10Ch+Text]
push	esi				; uType
push	esi				; lpCaption
push	ecx				; lpText
push	edx				; g_hWnd1
call	ds:MessageBoxA
mov	eax, dword ptr g_hWnd1
push	esi				; lParam
push	esi				; wParam
push	2				; Msg
push	eax				; g_hWnd1
call	ds:SendMessageA
pop	edi
xor	al, al
pop	esi
add	esp, 104h
retn
; ---------------------------------------------------------------------------

loc_43BF05:				; CODE XREF: sub_43BEA0+21j
push	2				; int
push	0				; __int32
push	esi				; FILE *
call	_fseek
push	esi				; FILE *
call	_ftell
push	0				; int
push	0				; __int32
push	esi				; FILE *
mov	edi, eax
call	_fseek
add	esp, 1Ch
cmp	edi, 10003h
jz	short loc_43BF3C
call	sub_43BE70
pop	edi
xor	al, al
pop	esi
add	esp, 104h
retn
; ---------------------------------------------------------------------------

loc_43BF3C:				; CODE XREF: sub_43BEA0+8Aj
push	esi				; FILE *
push	1				; size_t
lea	ecx, [esp+114h+var_101]
push	1				; size_t
push	ecx				; void *
call	_fread
push	esi				; FILE *
push	1				; size_t
lea	edx, [esp+124h+var_103]
push	1				; size_t
push	edx				; void *
call	_fread
push	esi				; FILE *
push	1				; size_t
lea	eax, [esp+134h+var_102]
push	1				; size_t
push	eax				; void *
call	_fread
push	esi				; FILE *
push	1				; size_t
push	10000h				; size_t
push	offset byte_81AA364		; void *
call	_fread
mov	cl, [esp+14Ch+var_101]
add	esp, 40h
xor	al, al
test	cl, cl
jnz	short loc_43BF98
mov	dl, [esp+10Ch+var_103]
mov	cl, 0FFh
cmp	dl, cl
jnz	short loc_43BF98
cmp	[esp+10Ch+var_102], cl
jz	short loc_43BF9A

loc_43BF98:				; CODE XREF: sub_43BEA0+E6j
					; sub_43BEA0+F0j
mov	al, 1

loc_43BF9A:				; CODE XREF: sub_43BEA0+F6j
mov	cl, byte_81C1648
test	cl, cl
jnz	short loc_43BFED		; jumptable 0043BFAF default case
mov	ecx, dword ptr dword_81C1528
cmp	ecx, 4				; switch 5 cases
ja	short loc_43BFED		; jumptable 0043BFAF default case
jmp	ds:off_43C02C[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_43BFB6:				; CODE XREF: sub_43BEA0+10Fj
					; DATA XREF: .text:off_43C02Co
cmp	byte_81B1EEB, 5			; jumptable 0043BFAF case 0
jz	short loc_43BFED		; jumptable 0043BFAF default case
jmp	short loc_43BFEB
; ---------------------------------------------------------------------------

loc_43BFC1:				; CODE XREF: sub_43BEA0+10Fj
					; DATA XREF: .text:off_43C02Co
cmp	byte_81B1C47, 4			; jumptable 0043BFAF case 1
jz	short loc_43BFED		; jumptable 0043BFAF default case
jmp	short loc_43BFEB
; ---------------------------------------------------------------------------

loc_43BFCC:				; CODE XREF: sub_43BEA0+10Fj
					; DATA XREF: .text:off_43C02Co
cmp	byte_81ADB34, 5			; jumptable 0043BFAF case 2
jz	short loc_43BFED		; jumptable 0043BFAF default case
jmp	short loc_43BFEB
; ---------------------------------------------------------------------------

loc_43BFD7:				; CODE XREF: sub_43BEA0+10Fj
					; DATA XREF: .text:off_43C02Co
cmp	byte_81B1B1E, 5			; jumptable 0043BFAF case 3
jz	short loc_43BFED		; jumptable 0043BFAF default case
jmp	short loc_43BFEB
; ---------------------------------------------------------------------------

loc_43BFE2:				; CODE XREF: sub_43BEA0+10Fj
					; DATA XREF: .text:off_43C02Co
cmp	byte_81AEF25, 5			; jumptable 0043BFAF case 4
jz	short loc_43BFED		; jumptable 0043BFAF default case

loc_43BFEB:				; CODE XREF: sub_43BEA0+11Fj
					; sub_43BEA0+12Aj ...
mov	al, 1

loc_43BFED:				; CODE XREF: sub_43BEA0+102j
					; sub_43BEA0+10Dj ...
xor	ecx, ecx			; jumptable 0043BFAF default case
mov	dl, 80h

loc_43BFF1:				; CODE XREF: sub_43BEA0+162j
cmp	byte_81AA364[ecx], dl
jb	short loc_43BFFB
mov	al, 1

loc_43BFFB:				; CODE XREF: sub_43BEA0+157j
inc	ecx
cmp	ecx, 10000h
jl	short loc_43BFF1
test	al, al
jz	short loc_43C018
call	sub_43BE70
pop	edi
xor	al, al
pop	esi
add	esp, 104h
retn
; ---------------------------------------------------------------------------

loc_43C018:				; CODE XREF: sub_43BEA0+166j
push	esi				; FILE *
call	_fclose
add	esp, 4
mov	al, 1
pop	edi
pop	esi
add	esp, 104h
retn
align 4
; ---------------------------------------------------------------------------
off_43C02C dd offset loc_43BFB6		; DATA XREF: sub_43BEA0+10Fr
dd offset loc_43BFC1			; jump table for switch	statement
dd offset loc_43BFCC
dd offset loc_43BFD7
dd offset loc_43BFE2
sub_43BEA0 endp


; =============== S U B	R O U T	I N E =======================================
align 10h

; int __cdecl sub_43C040(char *)
sub_43C040 proc	near			; CODE XREF: sub_44C220+8Fp

var_2= byte ptr	-2
var_1= byte ptr	-1
arg_0= dword ptr  4

push	ecx
mov	eax, [esp+4+arg_0]
push	esi
push	offset aWb			; "wb"
push	eax				; char *
call	_fopen
mov	esi, eax
lea	ecx, [esp+10h+arg_0]
push	esi				; FILE *
push	1				; size_t
mov	al, 0FFh
push	1				; size_t
push	ecx				; void *
mov	byte ptr [esp+20h+arg_0], 0
mov	[esp+20h+var_2], al
mov	[esp+20h+var_1], al
call	_fwrite
push	esi				; FILE *
push	1				; size_t
lea	edx, [esp+28h+var_2]
push	1				; size_t
push	edx				; void *
call	_fwrite
push	esi				; FILE *
push	1				; size_t
lea	eax, [esp+38h+var_1]
push	1				; size_t
push	eax				; void *
call	_fwrite
push	esi				; FILE *
push	1				; size_t
push	10000h				; size_t
push	offset byte_81AA364		; void *
call	_fwrite
add	esp, 48h
push	esi				; FILE *
call	_fclose
add	esp, 4
mov	al, 1
pop	esi
pop	ecx
retn
sub_43C040 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43C0C0(char *)
sub_43C0C0 proc	near			; CODE XREF: sub_44BCE0+6Fp

var_4= dword ptr -4
arg_0= dword ptr  4

push	ecx
push	ebx
call	sub_43BE20
mov	eax, [esp+8+arg_0]
push	offset aRb			; "rb"
push	eax				; char *
call	_fopen
mov	ebx, eax
add	esp, 8
test	ebx, ebx
jnz	short loc_43C0E4
xor	al, al
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_43C0E4:				; CODE XREF: sub_43C0C0+1Dj
push	ebp
push	esi
push	edi
push	2				; int
push	0				; __int32
push	ebx				; FILE *
call	_fseek
push	ebx				; FILE *
call	_ftell
push	0				; int
push	0				; __int32
push	ebx				; FILE *
mov	esi, eax
call	_fseek
push	esi				; unsigned int
call	new_mem_byte			; operator new(uint)
push	ebx				; FILE *
mov	ebp, eax
push	esi				; size_t
push	1				; size_t
push	ebp				; void *
call	_fread
push	ebx				; FILE *
call	_fclose
mov	ecx, 4000h
lea	esi, [ebp+1]
mov	edi, offset byte_7ED99EC
add	esp, 34h
rep movsd
mov	ecx, 4000h
lea	esi, [ebp+10001h]
mov	edi, offset byte_7EC99EC
mov	eax, offset g_alpha1
rep movsd
lea	esi, [ebp+20001h]

loc_43C14A:				; CODE XREF: sub_43C0C0+B4j
mov	cl, [esi]
add	eax, 4
mov	byte ptr [esp+14h+arg_0], cl
mov	edx, [esp+14h+arg_0]
and	edx, 0FFh
inc	esi
mov	[esp+14h+var_4], edx
cmp	eax, offset unk_81A9D40
fild	[esp+14h+var_4]
fmul	dword ptr flt_4789B4
fstp	dword ptr [eax-4]
jl	short loc_43C14A
push	ebp				; void *
call	delete_mem			; operator delete(void *)
push	ebx				; FILE *
call	_fclose
add	esp, 8
mov	al, 1
pop	edi
pop	esi
pop	ebp
pop	ebx
pop	ecx
retn
sub_43C0C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43C190(char *)
sub_43C190 proc	near			; CODE XREF: sub_44C220+6Ep

var_1= byte ptr	-1
arg_0= dword ptr  4

push	ecx
mov	eax, [esp+4+arg_0]
push	esi
push	edi
push	offset aWb			; "wb"
push	eax				; char *
call	_fopen
mov	esi, eax
lea	ecx, [esp+14h+arg_0]
push	esi				; FILE *
push	1				; size_t
push	1				; size_t
push	ecx				; void *
mov	byte ptr [esp+24h+arg_0], 0
call	_fwrite
push	esi				; FILE *
push	1				; size_t
push	10000h				; size_t
push	offset byte_7ED99EC		; void *
call	_fwrite
push	esi				; FILE *
push	1				; size_t
push	10000h				; size_t
push	offset byte_7EC99EC		; void *
call	_fwrite
add	esp, 38h
mov	edi, offset g_alpha1

loc_43C1E4:				; CODE XREF: sub_43C190+80j
fld	dword ptr [edi]
fmul	dword ptr flt_47875C
call	__ftol
push	esi				; FILE *
push	1				; size_t
lea	edx, [esp+14h+var_1]
push	1				; size_t
push	edx				; void *
mov	[esp+1Ch+var_1], al
call	_fwrite
add	edi, 4
add	esp, 10h
cmp	edi, offset unk_81A9D40
jl	short loc_43C1E4
mov	edi, offset unk_7FE9A24

loc_43C217:				; CODE XREF: sub_43C190+CFj
mov	al, [edi-4]
test	al, al
jz	short loc_43C256
push	esi				; FILE *
push	1				; size_t
lea	eax, [edi-2]
push	2				; size_t
push	eax				; void *
call	_fwrite
push	esi				; FILE *
push	1				; size_t
push	1				; size_t
push	edi				; void *
call	_fwrite
push	esi				; FILE *
push	1				; size_t
lea	ecx, [edi+1]
push	1				; size_t
push	ecx				; void *
call	_fwrite
push	esi				; FILE *
push	1				; size_t
lea	edx, [edi+2]
push	1				; size_t
push	edx				; void *
call	_fwrite
add	esp, 40h

loc_43C256:				; CODE XREF: sub_43C190+8Cj
add	edi, 8
cmp	edi, offset dword_7FE9D44
jl	short loc_43C217
push	esi				; FILE *
call	_fclose
add	esp, 4
mov	al, 1
pop	edi
pop	esi
pop	ecx
retn
sub_43C190 endp


; =============== S U B	R O U T	I N E =======================================


sub_43C270 proc	near			; CODE XREF: sub_43F220:loc_43F363p

var_C= dword ptr -0Ch
var_4= dword ptr -4

push	ecx
push	esi
mov	esi, offset byte_7FE9A25

loc_43C277:				; CODE XREF: sub_43C270+43j
mov	al, [esi-5]
test	al, al
jz	short loc_43C2AA
xor	eax, eax
push	ecx
mov	al, [esi+1]
xor	ecx, ecx
mov	[esp+0Ch+var_4], eax
mov	cl, [esi]
fild	[esp+0Ch+var_4]
xor	edx, edx
mov	dl, [esi-1]
fmul	dword ptr flt_4789B8
fstp	[esp+0Ch+var_C]			; int
push	ecx				; int
push	edx				; int
push	8				; texture
call	sub_43DDE0
add	esp, 10h

loc_43C2AA:				; CODE XREF: sub_43C270+Cj
add	esi, 8
cmp	esi, (offset dword_7FE9D44+1)
jl	short loc_43C277
pop	esi
pop	ecx
retn
sub_43C270 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43C2C0 proc	near			; CODE XREF: sub_430580+627p
					; sub_430580+661p ...

var_34=	dword ptr -34h
var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 34h
push	ebx
push	ebp
xor	eax, eax
push	esi
push	edi
mov	[esp+44h+var_2C], eax
mov	ebx, offset byte_7E099C0

loc_43C2D2:				; CODE XREF: sub_43C2C0+100j
fild	[esp+44h+var_2C]
lea	edi, [eax+1]
mov	ebp, eax
mov	[esp+44h+var_2C], edi
and	ebp, 0FFh
fmul	dword ptr flt_4786CC
and	edi, 0FFh
mov	esi, 1
shl	ebp, 8
shl	edi, 8
fstp	[esp+44h+var_28]
fild	[esp+44h+var_2C]
mov	[esp+44h+var_30], esi
fmul	dword ptr flt_4786CC
fstp	[esp+44h+var_34]

loc_43C312:				; CODE XREF: sub_43C2C0+ECj
mov	eax, [esp+44h+var_28]
mov	edx, [esp+44h+var_34]
fild	[esp+44h+var_30]
mov	[esp+44h+var_8], eax
mov	eax, esi
and	eax, 0FFh
mov	[esp+44h+var_14], edx
fmul	dword ptr flt_4786CC
lea	ecx, [eax+ebp]
add	eax, edi
push	ebx
fst	[esp+48h+var_C]
fld dword ptr flt_7EE9A04[ecx*4]
mov	ecx, edx
lea	edx, [esp+48h+var_24]
fstp	[esp+48h+var_4]
mov	[esp+48h+var_20], ecx
push	edx
fstp	[esp+4Ch+var_18]
fld dword ptr flt_7EE9A04[eax*4]
lea	eax, [esi-1]
lea	ecx, [esp+4Ch+var_C]
fstp	[esp+4Ch+var_10]
mov	[esp+4Ch+var_30], eax
and	eax, 0FFh
fild	[esp+4Ch+var_30]
add	eax, edi
fmul	dword ptr flt_4786CC
fstp	[esp+4Ch+var_24]
fld dword ptr flt_7EE9A04[eax*4]
lea	eax, [esp+4Ch+var_18]
fstp	[esp+4Ch+var_1C]
push	eax
push	ecx
call	sub_43FC50
add	esp, 10h
add	ebx, 0Ch
inc	esi
mov	[esp+44h+var_30], esi
lea	edx, [esi-1]
cmp	edx, 100h
jl	loc_43C312
mov	eax, [esp+44h+var_2C]
cmp	ebx, offset flt_7EC99C0
mov	[esp+44h+var_2C], eax
jl	loc_43C2D2
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 34h
retn
sub_43C2C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43C3D0 proc	near			; CODE XREF: sub_430580+62Cp
					; sub_430580+666p ...
xor	ecx, ecx

loc_43C3D2:				; CODE XREF: sub_43C3D0+81j
mov	edx, 100h

loc_43C3D7:				; CODE XREF: sub_43C3D0+79j
fld	dword ptr [ecx+byte_7E099C0]
fadd	dword ptr [ecx+byte_7E099C0+8]
fmul	dword ptr flt_4786E0
fld	dword ptr [ecx+byte_7E099C0+4]
fmul	dword ptr flt_4786E0
fsubp	st(1), st
fadd	dword ptr flt_4786E0
fcom	dword ptr flt_4786F4
fnstsw	ax
test	ah, 1
jz	short loc_43C414
fstp	st
fld	dword ptr flt_4786F4
jmp	short loc_43C429
; ---------------------------------------------------------------------------

loc_43C414:				; CODE XREF: sub_43C3D0+38j
fcom	dword ptr flt_4786B8
fnstsw	ax
test	ah, 41h
jnz	short loc_43C429
fstp	st
fld	dword ptr flt_4786B8

loc_43C429:				; CODE XREF: sub_43C3D0+42j
					; sub_43C3D0+4Fj
mov	eax, ecx
mov	ecx, 3

loc_43C430:				; CODE XREF: sub_43C3D0+72j
fld	st
fmul	dword ptr [eax+byte_7D09970]
add	eax, 4
dec	ecx
fstp	dword ptr (byte_8080408+29934h)[eax]
jnz	short loc_43C430
dec	edx
mov	ecx, eax
fstp	st
jnz	short loc_43C3D7
cmp	ecx, 0C0000h
jl	loc_43C3D2
retn
sub_43C3D0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43C480(char *)
sub_43C480 proc	near			; CODE XREF: sub_44C220+32p

arg_0= dword ptr  4

push	ebx
push	ebp
push	esi
push	edi
push	30000h				; unsigned int
call	new_mem_byte			; operator new(uint)
mov	ebp, eax
add	esp, 4
mov	ebx, ebp
mov	edi, offset byte_7D09970

loc_43C49A:				; CODE XREF: sub_43C480+6Aj
xor	esi, esi

loc_43C49C:				; CODE XREF: sub_43C480+5Fj
fld	dword ptr [edi]
fmul	dword ptr flt_47875C
fcom	dword ptr flt_4786F4
fnstsw	ax
test	ah, 1
jz	short loc_43C4BB
fstp	st
fld	dword ptr flt_4786F4
jmp	short loc_43C4D0
; ---------------------------------------------------------------------------

loc_43C4BB:				; CODE XREF: sub_43C480+2Fj
fcom	dword ptr flt_47875C
fnstsw	ax
test	ah, 41h
jnz	short loc_43C4D0
fstp	st
fld	dword ptr flt_47875C

loc_43C4D0:				; CODE XREF: sub_43C480+39j
					; sub_43C480+46j
call	__ftol
mov	[ebx+esi], al
inc	esi
add	edi, 4
cmp	esi, 3
jl	short loc_43C49C
add	ebx, 3
cmp	edi, offset byte_7DC9970
jl	short loc_43C49A
mov	eax, [esp+10h+arg_0]
push	64h				; int
push	ebp				; int
push	100h				; int
push	100h				; int
push	eax				; char *
call	sub_455CD0
push	ebp				; void *
call	delete_mem			; operator delete(void *)
add	esp, 18h
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_43C480 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43C520 proc	near			; CODE XREF: sub_44BCE0+E2p

arg_0= dword ptr  4

; FUNCTION CHUNK AT 0043F3A0 SIZE 0000001E BYTES

mov	eax, [esp+arg_0]
mov	byte_81BA378, 1
push	eax
call	sub_43C540
add	esp, 4
jmp	loc_43F3A0
sub_43C520 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43C540 proc	near			; CODE XREF: sub_43C520+Cp

var_204= dword ptr -204h
var_200= byte ptr -200h
Text= byte ptr -100h
var_FF=	byte ptr -0FFh
arg_0= dword ptr  4

mov	al, byte_47D538
sub	esp, 204h
test	al, al
push	ebx
push	ebp
push	esi
push	edi
jnz	short loc_43C58B
mov	edi, offset aData2		; "Data2\\"
or	ecx, 0FFFFFFFFh
xor	eax, eax
lea	edx, [esp+214h+var_200]
repne scasb
not	ecx
sub	edi, ecx
mov	ebp, [esp+214h+arg_0]
mov	eax, ecx
mov	esi, edi
mov	edi, edx
lea	edx, [esp+214h+var_200]
shr	ecx, 2
rep movsd
mov	ecx, eax
and	ecx, 3
rep movsb
mov	edi, ebp
jmp	loc_43C631
; ---------------------------------------------------------------------------

loc_43C58B:				; CODE XREF: sub_43C540+11j
mov	ebp, [esp+214h+arg_0]
or	ecx, 0FFFFFFFFh
mov	edi, ebp
xor	eax, eax
xor	esi, esi
repne scasb
not	ecx
dec	ecx
test	ecx, ecx
jle	short loc_43C5CA
lea	ebx, [esp+214h+Text]
mov	edx, ebp
sub	ebx, ebp

loc_43C5AF:				; CODE XREF: sub_43C540+88j
mov	al, [edx]
cmp	al, 2Eh
mov	[ebx+edx], al
jz	short loc_43C5CA
inc	esi
mov	edi, ebp
or	ecx, 0FFFFFFFFh
xor	eax, eax
inc	edx
repne scasb
not	ecx
dec	ecx
cmp	esi, ecx
jl	short loc_43C5AF

loc_43C5CA:				; CODE XREF: sub_43C540+62j
					; sub_43C540+76j
mov	edi, offset aData		; "Data\\"
or	ecx, 0FFFFFFFFh
xor	eax, eax
mov	[esp+esi+214h+var_FF], 0
repne scasb
not	ecx
sub	edi, ecx
lea	edx, [esp+214h+var_200]
mov	eax, ecx
mov	esi, edi
mov	edi, edx
lea	edx, [esp+214h+var_200]
shr	ecx, 2
rep movsd
mov	ecx, eax
xor	eax, eax
and	ecx, 3
rep movsb
lea	edi, [esp+214h+Text]
or	ecx, 0FFFFFFFFh
repne scasb
not	ecx
sub	edi, ecx
mov	esi, edi
mov	ebx, ecx
mov	edi, edx
or	ecx, 0FFFFFFFFh
repne scasb
mov	ecx, ebx
dec	edi
shr	ecx, 2
rep movsd
mov	ecx, ebx
lea	edx, [esp+214h+var_200]
and	ecx, 3
rep movsb
mov	edi, offset aOzb		; "OZB"

loc_43C631:				; CODE XREF: sub_43C540+46j
or	ecx, 0FFFFFFFFh
xor	eax, eax
repne scasb
not	ecx
sub	edi, ecx
push	offset aRb			; "rb"
mov	esi, edi
mov	ebx, ecx
mov	edi, edx
or	ecx, 0FFFFFFFFh
repne scasb
mov	ecx, ebx
dec	edi
shr	ecx, 2
rep movsd
mov	ecx, ebx
lea	eax, [esp+218h+var_200]
and	ecx, 3
push	eax				; char *
rep movsb
call	_fopen
mov	esi, eax
add	esp, 8
test	esi, esi
jnz	short loc_43C6BD
lea	ecx, [esp+214h+var_200]
lea	edx, [esp+214h+Text]
push	ecx
push	offset aSFileNotFound_		; "%s file not found."
push	edx				; char *
call	_sprintf
mov	ecx, dword ptr g_hWnd1
add	esp, 0Ch
lea	eax, [esp+214h+Text]
push	esi				; uType
push	esi				; lpCaption
push	eax				; lpText
push	ecx				; g_hWnd1
call	ds:MessageBoxA
mov	edx, dword ptr g_hWnd1
push	esi				; lParam
push	esi				; wParam
push	2				; Msg
push	edx				; g_hWnd1
call	ds:SendMessageA
pop	edi
pop	esi
pop	ebp
xor	al, al
pop	ebx
add	esp, 204h
retn
; ---------------------------------------------------------------------------

loc_43C6BD:				; CODE XREF: sub_43C540+12Cj
mov	al, byte_47D538
test	al, al
jz	short loc_43C6D3
push	0				; int
push	4				; __int32
push	esi				; FILE *
call	_fseek
add	esp, 0Ch

loc_43C6D3:				; CODE XREF: sub_43C540+184j
push	10438h				; unsigned int
call	new_mem_byte			; operator new(uint)
push	esi				; FILE *
mov	ebx, eax
push	10438h				; size_t
push	1				; size_t
push	ebx				; void *
call	_fread
push	esi				; FILE *
call	_fclose
mov	al, byte_47D538
add	esp, 18h
mov	ecx, 10Eh
mov	esi, ebx
mov	edi, offset byte_81A9EF4
test	al, al
rep movsd
jnz	short loc_43C723
push	10438h				; size_t
push	ebx				; void *
push	ebp				; int
push	offset aOzb			; int
push	4				; size_t
call	sub_455E00
add	esp, 14h

loc_43C723:				; CODE XREF: sub_43C540+1CBj
mov	edi, offset flt_7EE9A04
lea	ebp, [ebx+438h]

loc_43C72E:				; CODE XREF: sub_43C540+225j
mov	eax, ebp
mov	ecx, edi
mov	esi, 100h

loc_43C737:				; CODE XREF: sub_43C540+211j
xor	edx, edx
add	ecx, 4
mov	dl, [eax]
inc	eax
mov	[esp+214h+var_204], edx
dec	esi
fild	[esp+214h+var_204]
fmul	dword ptr flt_478794
fstp	dword ptr [ecx-4]
jnz	short loc_43C737
add	edi, 400h
add	ebp, 100h
cmp	edi, offset flt_7F29A04
jl	short loc_43C72E
push	ebx				; void *
call	delete_mem			; operator delete(void *)
add	esp, 4
mov	al, 1
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 204h
retn
sub_43C540 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43C780(char *)
sub_43C780 proc	near			; CODE XREF: sub_44C220+50p

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 8
push	ebx
push	ebp
push	esi
push	edi
push	10000h				; unsigned int
call	new_mem_byte			; operator new(uint)
add	esp, 4
mov	[esp+18h+var_4], eax
add	eax, 0FF00h
mov	ebp, offset flt_7EE9A04
mov	[esp+18h+var_8], eax

loc_43C7A6:				; CODE XREF: sub_43C780+8Dj
mov	esi, [esp+18h+var_8]
mov	edi, ebp
mov	ebx, 100h

loc_43C7B1:				; CODE XREF: sub_43C780+71j
fld	dword ptr [edi]
fmul	dword ptr flt_4789BC
fcom	dword ptr flt_4786F4
fnstsw	ax
test	ah, 1
jz	short loc_43C7D0
fstp	st
fld	dword ptr flt_4786F4
jmp	short loc_43C7E5
; ---------------------------------------------------------------------------

loc_43C7D0:				; CODE XREF: sub_43C780+44j
fcom	dword ptr flt_47875C
fnstsw	ax
test	ah, 41h
jnz	short loc_43C7E5
fstp	st
fld	dword ptr flt_47875C

loc_43C7E5:				; CODE XREF: sub_43C780+4Ej
					; sub_43C780+5Bj
call	__ftol
mov	[esi], al
add	edi, 4
inc	esi
dec	ebx
jnz	short loc_43C7B1
mov	ecx, [esp+18h+var_8]
add	ebp, 400h
sub	ecx, 100h
cmp	ebp, offset flt_7F29A04
mov	[esp+18h+var_8], ecx
jl	short loc_43C7A6
mov	eax, [esp+18h+arg_0]
push	offset aWb			; "wb"
push	eax				; char *
call	_fopen
mov	edi, eax
push	edi				; FILE *
push	1				; size_t
push	438h				; size_t
push	offset byte_81A9EF4		; void *
call	_fwrite
mov	ecx, [esp+30h+var_4]
add	esp, 18h
mov	ebx, 100h
lea	esi, [ecx+0FF00h]

loc_43C844:				; CODE XREF: sub_43C780+DCj
push	edi				; FILE *
push	1				; size_t
push	100h				; size_t
push	esi				; void *
call	_fwrite
add	esp, 10h
sub	esi, 100h
dec	ebx
jnz	short loc_43C844
mov	edx, [esp+18h+var_4]
push	edx				; void *
call	delete_mem			; operator delete(void *)
push	edi				; FILE *
call	_fclose
add	esp, 8
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 8
retn
sub_43C780 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43C880(float,	float)
sub_43C880 proc	near			; CODE XREF: sub_407C30+17Bp
					; sub_408540+76p ...

arg_0= dword ptr  4
arg_4= dword ptr  8

cmp	dword ptr nScene_482904, 5
jz	short loc_43C890
fld	dword ptr flt_4786F4
retn
; ---------------------------------------------------------------------------

loc_43C890:				; CODE XREF: sub_43C880+7j
fld	[esp+arg_0]
fmul	dword ptr flt_478770
fld	[esp+arg_4]
fmul	dword ptr flt_478770
push	esi
push	edi
fld	st(1)
call	__ftol
mov	esi, eax
fld	st
mov	[esp+8+arg_4], esi
call	__ftol
mov	ecx, eax
mov	edx, esi
and	ecx, 0FFh
and	edx, 0FFh
shl	ecx, 8
inc	esi
mov	[esp+8+arg_0], eax
and	esi, 0FFh
lea	edi, [edx+ecx]
fisub	[esp+8+arg_0]
add	ecx, esi
inc	eax
and	eax, 0FFh
shl	eax, 8
add	edx, eax
add	eax, esi
fld dword ptr flt_7EE9A04[edx*4]
fsub	dword ptr flt_7EE9A04[edi*4]
fmul	st, st(1)
fadd	dword ptr flt_7EE9A04[edi*4]
fld dword ptr flt_7EE9A04[eax*4]
fsub	dword ptr flt_7EE9A04[ecx*4]
pop	edi
pop	esi
fmul	st, st(2)
fadd	dword ptr flt_7EE9A04[ecx*4]
fsub	st, st(1)
fild	[esp+arg_4]
fsubr	st, st(4)
fmulp	st(1), st
fadd	st, st(1)
fstp	st(3)
fstp	st
fstp	st
retn
sub_43C880 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43C940(float,	float, float, int, int)
sub_43C940 proc	near			; CODE XREF: sub_430580+61Fp
					; sub_430580+659p

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 8
fild	[esp+8+arg_C]
push	esi
fstp	[esp+0Ch+var_8]
fld	[esp+0Ch+arg_0]
fmul	dword ptr flt_478770
fstp	[esp+0Ch+arg_0]
fld	[esp+0Ch+arg_4]
fmul	dword ptr flt_478770
fstp	[esp+0Ch+arg_4]
fld	[esp+0Ch+arg_0]
call	__ftol
fld	[esp+0Ch+arg_4]
mov	esi, eax
call	__ftol
mov	ecx, [esp+0Ch+arg_C]
mov	edx, eax
sub	edx, ecx
add	eax, ecx
mov	[esp+0Ch+arg_C], edx
cmp	edx, eax
fild	[esp+0Ch+arg_C]
mov	[esp+0Ch+var_4], eax
jg	loc_43CA34
push	ebx
push	ebp
push	edi
mov	ebx, esi
lea	edi, [esi+ecx]
mov	esi, [esp+18h+arg_10]
sub	ebx, ecx

loc_43C9A8:				; CODE XREF: sub_43C940+EBj
mov	ecx, ebx
mov	[esp+18h+arg_C], ecx
cmp	ecx, edi
fild	[esp+18h+arg_C]
jg	loc_43CA3B
fld	[esp+18h+arg_4]
fsub	st, st(2)
fld	st
fmulp	st(1), st

loc_43C9C4:				; CODE XREF: sub_43C940+D8j
fld	[esp+18h+arg_0]
fsub	st, st(2)
fld	st
fmulp	st(1), st
fadd	st, st(1)
fsqrt
fsubr	[esp+18h+var_8]
fdiv	[esp+18h+var_8]
fcom	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	short loc_43CA09
mov	eax, edx
mov	ebp, ecx
fmul	[esp+18h+arg_8]
and	eax, 0FFh
and	ebp, 0FFh
shl	eax, 8
add	eax, ebp
fadd	dword ptr [esi+eax*4]
lea	eax, [esi+eax*4]
fstp	dword ptr [eax]
jmp	short loc_43CA0B
; ---------------------------------------------------------------------------

loc_43CA09:				; CODE XREF: sub_43C940+A5j
fstp	st

loc_43CA0B:				; CODE XREF: sub_43C940+C7j
inc	ecx
fxch	st(1)
fadd	dword ptr flt_4786B8
fxch	st(1)
cmp	ecx, edi
jle	short loc_43C9C4
mov	eax, [esp+18h+var_4]
fstp	st
fstp	st

loc_43CA22:				; CODE XREF: sub_43C940+FDj
fadd	dword ptr flt_4786B8
inc	edx
cmp	edx, eax
jle	loc_43C9A8
pop	edi
pop	ebp
pop	ebx

loc_43CA34:				; CODE XREF: sub_43C940+54j
fstp	st
pop	esi
add	esp, 8
retn
; ---------------------------------------------------------------------------

loc_43CA3B:				; CODE XREF: sub_43C940+74j
fstp	st
jmp	short loc_43CA22
sub_43C940 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43CA40(float,	float, int, int, int)
sub_43CA40 proc	near			; CODE XREF: sub_414DF0+390p
					; sub_414DF0+BF4p ...

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 10h
fild	[esp+10h+arg_C]
push	ebx
push	esi
fstp	[esp+18h+var_10]
fld	[esp+18h+arg_0]
fmul	dword ptr flt_478770
fstp	[esp+18h+arg_0]
fld	[esp+18h+arg_4]
fmul	dword ptr flt_478770
fstp	[esp+18h+arg_4]
fld	[esp+18h+arg_0]
call	__ftol
fld	[esp+18h+arg_4]
mov	esi, eax
call	__ftol
mov	ecx, [esp+18h+arg_C]
mov	ebx, eax
sub	ebx, ecx
add	eax, ecx
mov	[esp+18h+arg_C], ebx
cmp	ebx, eax
fild	[esp+18h+arg_C]
mov	[esp+18h+var_8], eax
jg	loc_43CB6E
push	ebp
mov	ebp, [esp+1Ch+arg_10]
push	edi
mov	edi, esi
sub	edi, ecx
add	ecx, esi
mov	[esp+20h+var_4], edi
mov	[esp+20h+var_C], ecx

loc_43CAAF:				; CODE XREF: sub_43CA40+126j
mov	[esp+20h+arg_C], edi
cmp	edi, ecx
fild	[esp+20h+arg_C]
jg	loc_43CB76
fld	[esp+20h+arg_4]
fsub	st, st(2)
fld	st
fmulp	st(1), st

loc_43CAC9:				; CODE XREF: sub_43CA40+10Bj
fld	[esp+20h+arg_0]
fsub	st, st(2)
fld	st
fmulp	st(1), st
fadd	st, st(1)
fsqrt
fsubr	[esp+20h+var_10]
fdiv	[esp+20h+var_10]
fst	[esp+20h+arg_C]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	short loc_43CB3E
mov	eax, ebx
mov	ecx, edi
and	eax, 0FFh
and	ecx, 0FFh
shl	eax, 8
add	eax, ecx
mov	esi, 3
lea	edx, [eax+eax*2]
lea	ecx, [ebp+edx*4+0]
mov	edx, [esp+20h+arg_8]
sub	edx, ecx

loc_43CB16:				; CODE XREF: sub_43CA40+F8j
fld	[esp+20h+arg_C]
fmul	dword ptr [edx+ecx]
fadd	dword ptr [ecx]
fst	dword ptr [ecx]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 1
jz	short loc_43CB34
mov	dword ptr [ecx], 0

loc_43CB34:				; CODE XREF: sub_43CA40+ECj
add	ecx, 4
dec	esi
jnz	short loc_43CB16
mov	ecx, [esp+20h+var_C]

loc_43CB3E:				; CODE XREF: sub_43CA40+AEj
inc	edi
fxch	st(1)
fadd	dword ptr flt_4786B8
fxch	st(1)
cmp	edi, ecx
jle	loc_43CAC9
mov	eax, [esp+20h+var_8]
mov	edi, [esp+20h+var_4]
fstp	st
fstp	st

loc_43CB5D:				; CODE XREF: sub_43CA40+138j
fadd	dword ptr flt_4786B8
inc	ebx
cmp	ebx, eax
jle	loc_43CAAF
pop	edi
pop	ebp

loc_43CB6E:				; CODE XREF: sub_43CA40+55j
pop	esi
pop	ebx
fstp	st
add	esp, 10h
retn
; ---------------------------------------------------------------------------

loc_43CB76:				; CODE XREF: sub_43CA40+79j
fstp	st
jmp	short loc_43CB5D
sub_43CA40 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43CB80(float,	float, int, int, int)
sub_43CB80 proc	near			; CODE XREF: sub_430580+763p

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 10h
fild	[esp+10h+arg_C]
push	ebx
push	esi
fstp	[esp+18h+var_10]
fld	[esp+18h+arg_0]
fmul	dword ptr flt_478770
fstp	[esp+18h+arg_0]
fld	[esp+18h+arg_4]
fmul	dword ptr flt_478770
fstp	[esp+18h+arg_4]
fld	[esp+18h+arg_0]
call	__ftol
fld	[esp+18h+arg_4]
mov	esi, eax
call	__ftol
mov	ecx, [esp+18h+arg_C]
mov	ebx, eax
sub	ebx, ecx
add	eax, ecx
mov	[esp+18h+arg_C], ebx
cmp	ebx, eax
fild	[esp+18h+arg_C]
mov	[esp+18h+var_8], eax
jg	loc_43CCCF
push	ebp
mov	ebp, [esp+1Ch+arg_10]
push	edi
mov	edi, esi
sub	edi, ecx
add	ecx, esi
mov	[esp+20h+var_4], edi
mov	[esp+20h+var_C], ecx

loc_43CBEF:				; CODE XREF: sub_43CB80+147j
mov	[esp+20h+arg_C], edi
cmp	edi, ecx
fild	[esp+20h+arg_C]
jg	loc_43CCD7
fld	[esp+20h+arg_4]
fsub	st, st(2)
fld	st
fmulp	st(1), st

loc_43CC09:				; CODE XREF: sub_43CB80+12Cj
fld	[esp+20h+arg_0]
fsub	st, st(2)
fld	st
fmulp	st(1), st
fadd	st, st(1)
fsqrt
fsubr	[esp+20h+var_10]
fdiv	[esp+20h+var_10]
fst	[esp+20h+arg_C]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	short loc_43CC9F
mov	eax, ebx
mov	ecx, edi
and	eax, 0FFh
and	ecx, 0FFh
shl	eax, 8
add	eax, ecx
mov	esi, 3
lea	edx, [eax+eax*2]
lea	ecx, [ebp+edx*4+0]
mov	edx, [esp+20h+arg_8]
sub	edx, ecx

loc_43CC56:				; CODE XREF: sub_43CB80+119j
fld	[esp+20h+arg_C]
fmul	dword ptr [edx+ecx]
fadd	dword ptr [ecx]
fst	[esp+20h+arg_10]
fstp	dword ptr [ecx]
fld	[esp+20h+arg_10]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 1
jz	short loc_43CC7E
mov	dword ptr [ecx], 0
jmp	short loc_43CC95
; ---------------------------------------------------------------------------

loc_43CC7E:				; CODE XREF: sub_43CB80+F4j
fld	[esp+20h+arg_10]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 41h
jnz	short loc_43CC95
mov	dword ptr [ecx], 3F800000h

loc_43CC95:				; CODE XREF: sub_43CB80+FCj
					; sub_43CB80+10Dj
add	ecx, 4
dec	esi
jnz	short loc_43CC56
mov	ecx, [esp+20h+var_C]

loc_43CC9F:				; CODE XREF: sub_43CB80+AEj
inc	edi
fxch	st(1)
fadd	dword ptr flt_4786B8
fxch	st(1)
cmp	edi, ecx
jle	loc_43CC09
mov	eax, [esp+20h+var_8]
mov	edi, [esp+20h+var_4]
fstp	st
fstp	st

loc_43CCBE:				; CODE XREF: sub_43CB80+159j
fadd	dword ptr flt_4786B8
inc	ebx
cmp	ebx, eax
jle	loc_43CBEF
pop	edi
pop	ebp

loc_43CCCF:				; CODE XREF: sub_43CB80+55j
pop	esi
pop	ebx
fstp	st
add	esp, 10h
retn
; ---------------------------------------------------------------------------

loc_43CCD7:				; CODE XREF: sub_43CB80+79j
fstp	st
jmp	short loc_43CCBE
sub_43CB80 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43CCE0(float,	float, int)
sub_43CCE0 proc	near			; CODE XREF: sub_416D40+571p
					; sub_41BC80+70p ...

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	eax, dword ptr nScene_482904
sub	esp, 8
push	ebx
xor	ebx, ebx
cmp	eax, 5
push	esi
jnz	loc_43CDF0
cmp	byte_81BA378, bl
jz	loc_43CDF0
fld	[esp+10h+arg_0]
fmul	dword ptr flt_478770
fstp	[esp+10h+arg_0]
fld	[esp+10h+arg_4]
fmul	dword ptr flt_478770
fstp	[esp+10h+arg_4]
fld	[esp+10h+arg_0]
call	__ftol
fld	[esp+10h+arg_4]
mov	esi, eax
mov	[esp+10h+var_8], esi
call	__ftol
cmp	esi, ebx
mov	[esp+10h+var_4], eax
jl	loc_43CDF0
cmp	eax, ebx
jl	loc_43CDF0
cmp	esi, 0FEh
jg	loc_43CDF0
cmp	eax, 0FEh
jg	loc_43CDF0
fild	[esp+10h+var_8]
mov	ecx, eax
push	edi
shl	ecx, 8
fsubr	[esp+14h+arg_0]
fild	[esp+14h+var_4]
add	ecx, esi
inc	eax
shl	eax, 8
fsubr	[esp+14h+arg_4]
mov	edi, [esp+14h+arg_8]
add	eax, esi
lea	edx, [ecx+ecx*2+3]
lea	esi, [ecx+ecx*2+303h]
lea	ecx, [ecx+ecx*2]
lea	eax, [eax+eax*2]
lea	edx, dword_7FE9D40[edx*4]
lea	esi, dword_7FE9D40[esi*4]
lea	ecx, dword_7FE9D40[ecx*4]
lea	eax, dword_7FE9D40[eax*4]
mov	ebx, 3

loc_43CDB4:				; CODE XREF: sub_43CCE0+103j
fld	dword ptr [eax]
fsub	dword ptr [ecx]
add	eax, 4
add	ecx, 4
add	esi, 4
add	edx, 4
fmul	st, st(1)
add	edi, 4
dec	ebx
fadd	dword ptr [ecx-4]
fld	dword ptr [esi-4]
fsub	dword ptr [edx-4]
fmul	st, st(2)
fadd	dword ptr [edx-4]
fsub	st, st(1)
fmul	st, st(3)
fadd	st, st(1)
fstp	dword ptr [edi-4]
fstp	st
jnz	short loc_43CDB4
fstp	st
pop	edi
pop	esi
fstp	st
pop	ebx
add	esp, 8
retn
; ---------------------------------------------------------------------------

loc_43CDF0:				; CODE XREF: sub_43CCE0+Fj
					; sub_43CCE0+1Bj ...
mov	eax, [esp+10h+arg_8]
pop	esi
mov	[eax], ebx
mov	[eax+4], ebx
mov	[eax+8], ebx
pop	ebx
add	esp, 8
retn
sub_43CCE0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43CE10 proc	near			; CODE XREF: sub_43D320+CFp
					; sub_43DA90+100p

arg_0= dword ptr  4

call	sub_44E1C0
mov	eax, [esp+arg_0]
add	eax, 23h
push	eax				; texture
call	sub_44E0A0
mov	al, byte_81BA37A
add	esp, 4
test	al, al
jnz	locret_43CEFA
push	ebx				; t
push	esi				; v
push	edi
push	6				; mode
call	ds:glBegin
mov	ecx, dword ptr dword_7E09974
mov	edx, dword ptr dword_7E09970
mov	esi, ds:glTexCoord2f
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9924
mov	edi, ds:glColor3fv
lea	eax, [eax+eax*2]
lea	ecx, dword_7FE9D40[eax*4]
push	ecx				; v
call	edi ; glColor3fv
mov	ebx, ds:glVertex3fv
push	offset flt_7E09990		; v
call	ebx ; glVertex3fv
mov	edx, dword ptr dword_7E0997C
mov	eax, dword ptr dword_7E09978
push	edx				; t
push	eax				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9928
lea	ecx, [eax+eax*2]
lea	edx, dword_7FE9D40[ecx*4]
push	edx				; v
call	edi ; glColor3fv
push	offset flt_7E0999C		; v
call	ebx ; glVertex3fv
mov	eax, dword ptr dword_7E09984
mov	ecx, dword ptr dword_7E09980
push	eax				; t
push	ecx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC992C
lea	edx, [eax+eax*2]
lea	eax, dword_7FE9D40[edx*4]
push	eax				; v
call	edi ; glColor3fv
push	offset flt_7E099A8		; v
call	ebx ; glVertex3fv
mov	ecx, dword ptr dword_7E0998C
mov	edx, dword ptr dword_7E09988
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9930
lea	eax, [eax+eax*2]
lea	ecx, dword_7FE9D40[eax*4]
push	ecx				; v
call	edi ; glColor3fv
push	offset flt_7E099B4		; v
call	ebx ; glVertex3fv
call	ds:glEnd
pop	edi
pop	esi
pop	ebx

locret_43CEFA:				; CODE XREF: sub_43CE10+1Cj
retn
sub_43CE10 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43CF00 proc	near			; CODE XREF: sub_43D320+214p

arg_0= dword ptr  4

push	1
call	sub_44E240
mov	eax, [esp+4+arg_0]
add	eax, 23h
push	eax				; texture
call	sub_44E0A0
mov	al, byte_81BA37A
add	esp, 8
test	al, al
jnz	locret_43D057
push	ebx				; green
push	esi				; v
push	edi
push	6				; mode
call	ds:glBegin
mov	ecx, dword ptr dword_7E09974
mov	edx, dword ptr dword_7E09970
mov	esi, ds:glTexCoord2f
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	ecx, dword ptr dword_7CC9924
mov	edi, ds:glColor4f
lea	eax, [ecx+ecx*2]
mov	ecx, dword ptr g_alpha1[ecx*4]
push	ecx				; alpha
mov	ecx, dword ptr dword_7FE9D44[eax*4]
mov	edx, dword ptr dword_7FE9D48[eax*4]
lea	eax, dword_7FE9D40[eax*4]
push	edx				; blue
push	ecx				; green
mov	edx, [eax]
push	edx				; red
call	edi ; glColor4f
mov	ebx, ds:glVertex3fv
push	offset flt_7E09990		; v
call	ebx ; glVertex3fv
mov	eax, dword ptr dword_7E0997C
mov	ecx, dword ptr dword_7E09978
push	eax				; t
push	ecx				; s
call	esi ; glTexCoord2f
mov	ecx, dword ptr dword_7CC9928
lea	edx, [ecx+ecx*2]
mov	ecx, dword ptr g_alpha1[ecx*4]
push	ecx				; alpha
mov	ecx, dword ptr dword_7FE9D44[edx*4]
lea	eax, dword_7FE9D40[edx*4]
mov	edx, dword ptr dword_7FE9D48[edx*4]
push	edx				; blue
mov	edx, [eax]
push	ecx				; green
push	edx				; red
call	edi ; glColor4f
push	offset flt_7E0999C		; v
call	ebx ; glVertex3fv
mov	eax, dword ptr dword_7E09984
mov	ecx, dword ptr dword_7E09980
push	eax				; t
push	ecx				; s
call	esi ; glTexCoord2f
mov	ecx, dword ptr dword_7CC992C
lea	edx, [ecx+ecx*2]
mov	ecx, dword ptr g_alpha1[ecx*4]
push	ecx				; alpha
mov	ecx, dword ptr dword_7FE9D44[edx*4]
lea	eax, dword_7FE9D40[edx*4]
mov	edx, dword ptr dword_7FE9D48[edx*4]
push	edx				; blue
mov	edx, [eax]
push	ecx				; green
push	edx				; red
call	edi ; glColor4f
push	offset flt_7E099A8		; v
call	ebx ; glVertex3fv
mov	eax, dword ptr dword_7E0998C
mov	ecx, dword ptr dword_7E09988
push	eax				; t
push	ecx				; s
call	esi ; glTexCoord2f
mov	ecx, dword ptr dword_7CC9930
lea	edx, [ecx+ecx*2]
mov	ecx, dword ptr g_alpha1[ecx*4]
push	ecx				; alpha
mov	ecx, dword ptr dword_7FE9D44[edx*4]
lea	eax, dword_7FE9D40[edx*4]
mov	edx, dword ptr dword_7FE9D48[edx*4]
push	edx				; blue
mov	edx, [eax]
push	ecx				; green
push	edx				; red
call	edi ; glColor4f
push	offset flt_7E099B4		; v
call	ebx ; glVertex3fv
call	ds:glEnd
pop	edi
pop	esi
pop	ebx

locret_43D057:				; CODE XREF: sub_43CF00+1Ej
retn
sub_43CF00 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43D060 proc	near			; CODE XREF: sub_43D320+175p

red= dword ptr	4

call	sub_44E2D0
mov	eax, [esp+red]
add	eax, 23h
push	eax				; texture
call	sub_44E0A0
mov	al, byte_81BA37A
add	esp, 4
test	al, al
jnz	locret_43D168
push	ebx				; green
push	esi				; v
push	edi
push	6				; mode
call	ds:glBegin
mov	ecx, dword ptr dword_7E09974
mov	edx, dword ptr dword_7E09970
mov	esi, ds:glTexCoord2f
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9924
mov	edi, ds:glColor3f
fld	dword ptr g_alpha1[eax*4]
fstp	[esp+0Ch+red]
mov	eax, [esp+0Ch+red]
push	eax				; blue
push	eax				; green
push	eax				; red
call	edi ; glColor3f
mov	ebx, ds:glVertex3fv
push	offset flt_7E09990		; v
call	ebx ; glVertex3fv
mov	ecx, dword ptr dword_7E0997C
mov	edx, dword ptr dword_7E09978
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9928
fld	dword ptr g_alpha1[eax*4]
fstp	[esp+0Ch+red]
mov	eax, [esp+0Ch+red]
push	eax				; blue
push	eax				; green
push	eax				; red
call	edi ; glColor3f
push	offset flt_7E0999C		; v
call	ebx ; glVertex3fv
mov	ecx, dword ptr dword_7E09984
mov	edx, dword ptr dword_7E09980
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC992C
fld	dword ptr g_alpha1[eax*4]
fstp	[esp+0Ch+red]
mov	eax, [esp+0Ch+red]
push	eax				; blue
push	eax				; green
push	eax				; red
call	edi ; glColor3f
push	offset flt_7E099A8		; v
call	ebx ; glVertex3fv
mov	ecx, dword ptr dword_7E0998C
mov	edx, dword ptr dword_7E09988
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9930
fld	dword ptr g_alpha1[eax*4]
fstp	[esp+0Ch+red]
mov	eax, [esp+0Ch+red]
push	eax				; blue
push	eax				; green
push	eax				; red
call	edi ; glColor3f
push	offset flt_7E099B4		; v
call	ebx ; glVertex3fv
call	ds:glEnd
pop	edi
pop	esi
pop	ebx

locret_43D168:				; CODE XREF: sub_43D060+1Cj
retn
sub_43D060 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43D170(float,	float, int, float, int)
sub_43D170 proc	near			; CODE XREF: sub_43D320+BFp
					; sub_43D320+169p ...

var_10=	dword ptr -10h
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

push	ecx
mov	eax, [esp+4+arg_0]
mov	cl, byte ptr [esp+4+arg_10]
lea	eax, [eax+eax*2]
shl	eax, 4
add	eax, offset byte_81C5040
test	cl, cl
jz	short loc_43D19D
fld	dword ptr flt_4788D4
fdiv	dword ptr [eax+20h]
fstp	[esp+4+var_4]
fld	dword ptr flt_4788D4
jmp	short loc_43D1B0
; ---------------------------------------------------------------------------

loc_43D19D:				; CODE XREF: sub_43D170+16j
fld	dword ptr flt_4789C4
fdiv	dword ptr [eax+20h]
fstp	[esp+4+var_4]
fld	dword ptr flt_4789C4

loc_43D1B0:				; CODE XREF: sub_43D170+2Bj
fdiv	dword ptr [eax+24h]
mov	al, byte ptr [esp+4+arg_C]
push	esi
test	al, al
push	edi
fstp	[esp+0Ch+arg_10]
fld	[esp+0Ch+var_4]
fmul	[esp+0Ch+arg_4]
fstp	[esp+0Ch+arg_4]
fld	[esp+0Ch+arg_10]
fmul	[esp+0Ch+arg_8]
fstp	[esp+0Ch+arg_0]
jnz	short loc_43D23A
mov	esi, [esp+0Ch+arg_0]
mov	edi, [esp+0Ch+arg_4]
push	ebx
push	esi				; int
push	edi				; float
push	offset dword_7E09970		; int
call	sub_44E6B0
fld	[esp+1Ch+arg_4]
fadd	[esp+1Ch+var_4]
push	esi				; int
fstp	[esp+20h+arg_C]
mov	esi, [esp+20h+arg_C]
push	esi				; float
push	offset dword_7E09978		; int
call	sub_44E6B0
fld	[esp+28h+arg_0]
fadd	[esp+28h+arg_10]
fstp	[esp+28h+arg_10]
mov	ebx, [esp+28h+arg_10]
push	ebx				; int
push	esi				; float
push	offset dword_7E09980		; int
call	sub_44E6B0
push	ebx				; int
push	edi				; float
push	offset dword_7E09988		; int
call	sub_44E6B0
add	esp, 30h
pop	ebx
pop	edi
pop	esi
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_43D23A:				; CODE XREF: sub_43D170+67j
fld dword ptr flt_7D0994C
fadd	[esp+0Ch+arg_4]
test	cl, cl
jz	short loc_43D26F
mov	eax, dword ptr dword_7CC9924
mov	ecx, dword ptr dword_7CC9928
fld dword ptr flt_7CC9938[eax*4]
fmul	dword ptr flt_4789C0
fld dword ptr flt_7CC9938[ecx*4]
fmul	dword ptr flt_4789C0
jmp	short loc_43D294
; ---------------------------------------------------------------------------

loc_43D26F:				; CODE XREF: sub_43D170+D6j
mov	edx, dword ptr dword_7CC9924
mov	eax, dword ptr dword_7CC9928
fld dword ptr flt_7CC9938[edx*4]
fmul	dword ptr flt_4787E8
fld dword ptr flt_7CC9938[eax*4]
fmul	dword ptr flt_4787E8

loc_43D294:				; CODE XREF: sub_43D170+FDj
fstp	[esp+0Ch+arg_C]
fadd	[esp+0Ch+arg_0]
fstp	[esp+0Ch+arg_8]
mov	ecx, [esp+0Ch+arg_8]
fstp	[esp+0Ch+arg_4]
mov	esi, [esp+0Ch+arg_4]
push	ecx				; int
push	esi				; float
push	offset dword_7E09970		; int
call	sub_44E6B0
fld	[esp+18h+arg_C]
fadd	[esp+18h+arg_0]
fstp	[esp+18h+arg_C]
fld	[esp+18h+arg_4]
fadd	[esp+18h+var_4]
mov	edx, [esp+18h+arg_C]
push	edx				; int
fstp	[esp+1Ch+arg_0]
mov	edi, [esp+1Ch+arg_0]
push	edi				; float
push	offset dword_7E09978		; int
call	sub_44E6B0
fld	[esp+24h+arg_C]
fadd	[esp+24h+arg_10]
add	esp, 14h
fstp	[esp+10h+var_10]		; int
push	edi				; float
push	offset dword_7E09980		; int
call	sub_44E6B0
fld	[esp+18h+arg_8]
fadd	[esp+18h+arg_10]
add	esp, 8
fstp	[esp+10h+var_10]		; int
push	esi				; float
push	offset dword_7E09988		; int
call	sub_44E6B0
add	esp, 0Ch
pop	edi
pop	esi
pop	ecx
retn
sub_43D170 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43D320 proc	near			; CODE XREF: sub_43D7D0+F8p

var_5= byte ptr	-5
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	eax, dword ptr dword_81AA338
sub	esp, 8
cmp	eax, 2
push	ebx
push	ebp				; t
push	esi				; v
push	edi
jz	loc_43D544
mov	ecx, dword ptr dword_7CC9924
mov	byte ptr [esp+18h+var_4], 0
fld	dword ptr g_alpha1[ecx*4]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 1
jnz	short loc_43D3B1
mov	eax, dword ptr dword_7CC9928
fld	dword ptr g_alpha1[eax*4]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 1
jnz	short loc_43D3B1
mov	edx, dword ptr dword_7CC992C
fld	dword ptr g_alpha1[edx*4]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 1
jnz	short loc_43D3B1
mov	eax, dword ptr dword_7CC9930
fld	dword ptr g_alpha1[eax*4]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 1
jnz	short loc_43D3B1
xor	edx, edx
mov	[esp+18h+var_5], 0
mov	dl, byte_7EC99EC[ecx]
mov	esi, edx
jmp	short loc_43D3CD
; ---------------------------------------------------------------------------

loc_43D3B1:				; CODE XREF: sub_43D320+32j
					; sub_43D320+4Bj ...
mov	al, byte_7ED99EC[ecx]
mov	[esp+18h+var_5], 1
mov	esi, eax
and	esi, 0FFh
cmp	al, 5
jnz	short loc_43D3CD
mov	byte ptr [esp+18h+var_4], 1

loc_43D3CD:				; CODE XREF: sub_43D320+8Fj
					; sub_43D320+A6j
mov	eax, [esp+18h+var_4]
mov	edi, [esp+18h+arg_4]
mov	ebp, [esp+18h+arg_0]
push	0				; int
push	eax				; float
push	edi				; int
push	ebp				; float
push	esi				; float
call	sub_43D170
mov	ebx, [esp+2Ch+arg_C]
mov	ecx, [esp+2Ch+arg_8]
push	ebx
push	ecx
push	esi
call	sub_43CE10
mov	eax, dword ptr dword_81C1528
mov	ecx, dword ptr dword_7CC9924
mov	edx, dword ptr dword_7CC9928
mov	esi, dword ptr dword_7CC992C
add	esp, 20h
cmp	eax, 7
jnz	loc_43D4A5
cmp	byte_7EC99EC[ecx], 5
jnz	loc_43D4A5
fld	dword ptr g_alpha1[ecx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	short loc_43D479
fld	dword ptr g_alpha1[edx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	short loc_43D479
fld	dword ptr g_alpha1[esi*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	short loc_43D479
mov	eax, dword ptr dword_7CC9930
fld	dword ptr g_alpha1[eax*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	short loc_43D4A5

loc_43D479:				; CODE XREF: sub_43D320+116j
					; sub_43D320+12Aj ...
mov	ecx, dword ptr dword_81BA380
push	1				; int
push	0				; float
push	edi				; int
lea	esi, [ecx+1Eh]
push	ebp				; float
push	esi				; float
call	sub_43D170
mov	edx, [esp+2Ch+arg_8]
push	ebx
push	edx
push	esi
call	sub_43D060
add	esp, 20h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 8
retn
; ---------------------------------------------------------------------------

loc_43D4A5:				; CODE XREF: sub_43D320+F1j
					; sub_43D320+FEj ...
mov	al, [esp+18h+var_5]
test	al, al
jz	loc_43D7C3
fld	dword ptr g_alpha1[ecx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	short loc_43D50A
fld	dword ptr g_alpha1[edx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	short loc_43D50A
fld	dword ptr g_alpha1[esi*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	short loc_43D50A
mov	eax, dword ptr dword_7CC9930
fld	dword ptr g_alpha1[eax*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	loc_43D7C3

loc_43D50A:				; CODE XREF: sub_43D320+1A3j
					; sub_43D320+1B7j ...
xor	edx, edx
mov	dl, byte_7EC99EC[ecx]
mov	esi, edx
cmp	esi, 5
jz	short loc_43D51E
mov	byte ptr [esp+18h+var_4], 0

loc_43D51E:				; CODE XREF: sub_43D320+1F7j
mov	eax, [esp+18h+var_4]
push	0				; int
push	eax				; float
push	edi				; int
push	ebp				; float
push	esi				; float
call	sub_43D170
mov	ecx, [esp+2Ch+arg_8]
push	ebx
push	ecx
push	esi
call	sub_43CF00
add	esp, 20h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 8
retn
; ---------------------------------------------------------------------------

loc_43D544:				; CODE XREF: sub_43D320+Fj
mov	ecx, dword ptr dword_7CC9924
fld	dword ptr g_alpha1[ecx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	loc_43D7C3
mov	edx, dword ptr dword_7CC9928
fld	dword ptr g_alpha1[edx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	loc_43D7C3
mov	eax, dword ptr dword_7CC992C
fld	dword ptr g_alpha1[eax*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	loc_43D7C3
mov	edx, dword ptr dword_7CC9930
fld	dword ptr g_alpha1[edx*4]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jz	loc_43D7C3
mov	eax, dword ptr dword_7F69A14
test	eax, eax
jnz	loc_43D7C3
xor	eax, eax
mov	al, byte_7ED99EC[ecx]
add	eax, 32h
lea	esi, [eax+eax*2]
shl	esi, 4
mov	ecx, dword ptr g_pixels1[esi]
test	ecx, ecx
jz	loc_43D7C3
push	eax				; texture
call	sub_44E0A0
fld	dword ptr [esi+flt_81C49D4]
fadd	st, st
mov	eax, [esp+1Ch+arg_C]
push	0				; int
and	eax, 0FFh
fstp	[esp+20h+arg_4]
fld	[esp+20h+arg_0]
fmul	dword ptr flt_478774
fadd	dword ptr flt_7F29A04[eax*4]
fstp	[esp+20h+arg_8]
mov	esi, [esp+20h+arg_8]
push	esi				; float
push	offset dword_7E09970		; int
call	sub_44E6B0
fld	[esp+28h+arg_8]
fadd	dword ptr flt_478774
push	0				; int
fstp	[esp+2Ch+arg_8]
mov	edi, [esp+2Ch+arg_8]
push	edi				; float
push	offset dword_7E09978		; int
call	sub_44E6B0
push	3F800000h			; int
push	edi				; float
push	offset dword_7E09980		; int
call	sub_44E6B0
push	3F800000h			; int
push	esi				; float
push	offset dword_7E09988		; int
call	sub_44E6B0
fld dword ptr flt_7E09998
fadd	[esp+4Ch+arg_4]
mov	eax, dword ptr flt_7E09998
mov	ecx, dword ptr flt_7E09990
mov	edx, dword ptr flt_7E09994
mov	dword ptr flt_7E099B4, ecx
mov	ecx, dword ptr dword_7CC9924
mov	dword ptr dword_7E099B8, edx
fstp	dword ptr flt_7E09998
fld dword ptr flt_7E099B0
fadd	[esp+4Ch+arg_4]
mov	edx, dword ptr dword_7CC9928
add	esp, 34h
mov	dword ptr flt_7E099BC, eax
push	7				; mode
fstp	dword ptr flt_7E099A4
fld dword ptr flt_7E09990
fsub	dword ptr flt_4786D0
fstp	dword ptr flt_7E09990
fld dword ptr flt_7E099A8
fsub	dword ptr flt_4786D0
fstp	dword ptr flt_7E0999C
fld dword ptr flt_7E09994
fadd	dword ptr flt_7CC9938[ecx*4]
fstp	dword ptr flt_7E09994
fld dword ptr flt_7E099AC
fadd	dword ptr flt_7CC9938[edx*4]
fstp	dword ptr flt_7E099A0
call	ds:glBegin
mov	eax, dword ptr dword_7E09974
mov	ecx, dword ptr dword_7E09970
mov	esi, ds:glTexCoord2f
push	eax				; t
push	ecx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9924
mov	edi, ds:glColor3fv
lea	edx, [eax+eax*2]
lea	eax, dword_7FE9D40[edx*4]
push	eax				; v
call	edi ; glColor3fv
mov	ebx, ds:glVertex3fv
push	offset flt_7E09990		; v
call	ebx ; glVertex3fv
mov	ecx, dword ptr dword_7E0997C
mov	edx, dword ptr dword_7E09978
push	ecx				; t
push	edx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9928
lea	eax, [eax+eax*2]
lea	ecx, dword_7FE9D40[eax*4]
push	ecx				; v
call	edi ; glColor3fv
push	offset flt_7E0999C		; v
call	ebx ; glVertex3fv
mov	edx, dword ptr dword_7E09984
mov	eax, dword ptr dword_7E09980
push	edx				; t
push	eax				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC992C
lea	ecx, [eax+eax*2]
lea	edx, dword_7FE9D40[ecx*4]
push	edx				; v
call	edi ; glColor3fv
push	offset flt_7E099A8		; v
call	ebx ; glVertex3fv
mov	eax, dword ptr dword_7E0998C
mov	ecx, dword ptr dword_7E09988
push	eax				; t
push	ecx				; s
call	esi ; glTexCoord2f
mov	eax, dword ptr dword_7CC9930
lea	edx, [eax+eax*2]
lea	eax, dword_7FE9D40[edx*4]
push	eax				; v
call	edi ; glColor3fv
push	offset flt_7E099B4		; v
call	ebx ; glVertex3fv
call	ds:glEnd

loc_43D7C3:				; CODE XREF: sub_43D320+18Bj
					; sub_43D320+1E4j ...
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 8
retn
sub_43D320 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43D7D0 proc	near			; CODE XREF: sub_42BB40+CCp
					; sub_42C5F0+830p ...

var_C= dword ptr -0Ch
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	dword ptr  18h
arg_18=	byte ptr  1Ch

sub	esp, 0Ch
fld	[esp+0Ch+arg_0]
fmul	dword ptr flt_4786CC
fld	[esp+0Ch+arg_4]
fmul	dword ptr flt_4786CC
push	ebx
push	esi				; v
mov	esi, [esp+14h+arg_C]
push	edi				; mode
mov	edi, [esp+18h+arg_8]
mov	eax, esi
shl	eax, 8
fld	st(1)
add	eax, edi
mov	ecx, [esp+18h+arg_14]
fstp	dword ptr flt_7E09990
mov	edx, eax
lea	ebx, [eax+ecx]
fst	dword ptr flt_7E09994
fld dword ptr flt_7EE9A04[edx*4]
lea	eax, [esi+ecx]
mov	dword ptr dword_7CC9924, edx
fstp	dword ptr flt_7E09998
fld	st(1)
fadd	dword ptr flt_4786CC
shl	eax, 8
add	eax, edi
mov	dword ptr dword_7CC9928, ebx
add	ecx, eax
mov	dword ptr dword_7CC9930, eax
fst	dword ptr flt_7E0999C
fld	st(1)
mov	dword ptr dword_7CC992C, ecx
fstp	dword ptr flt_7E099A0
fld dword ptr flt_7EE9A04[ebx*4]
fstp	dword ptr flt_7E099A4
fstp	dword ptr flt_7E099A8
fadd	dword ptr flt_4786CC
fst	[esp+18h+arg_C]
fstp	dword ptr flt_7E099AC
fld dword ptr flt_7EE9A04[ecx*4]
mov	ecx, [esp+18h+arg_C]
fstp	dword ptr flt_7E099B0
mov	dword ptr dword_7E099B8, ecx
fstp	dword ptr flt_7E099B4
fld dword ptr flt_7EE9A04[eax*4]
mov	al, [esp+18h+arg_18]
fstp	dword ptr flt_7E099BC
test	al, al
jnz	short loc_43D8D9
mov	dl, byte_81AA364[edx]
and	dl, 8
cmp	dl, 8
jz	short loc_43D8D0
mov	eax, [esp+18h+arg_10]
mov	ecx, [esp+18h+arg_4]
mov	edx, [esp+18h+arg_0]
push	eax
push	esi
push	edi
push	ecx
push	edx
call	sub_43D320
add	esp, 14h

loc_43D8D0:				; CODE XREF: sub_43D7D0+E5j
pop	edi
pop	esi
xor	al, al
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_43D8D9:				; CODE XREF: sub_43D7D0+D7j
mov	eax, dword ptr dword_7C41CC0
mov	edi, ds:glVertex3fv
push	ebp
mov	ebp, ds:glBegin
cmp	eax, 5
jz	short loc_43D92C
call	sub_44E180
push	3F000000h			; blue
push	3F000000h			; green
push	3F000000h			; red
call	ds:glColor3f
push	3				; mode
call	ebp ; glBegin
mov	esi, offset flt_7E09990

loc_43D913:				; CODE XREF: sub_43D7D0+14Fj
push	esi				; v
call	edi ; glVertex3fv
add	esi, 0Ch
cmp	esi, offset byte_7E099C0
jl	short loc_43D913
call	ds:glEnd
call	sub_44E1C0

loc_43D92C:				; CODE XREF: sub_43D7D0+11Ej
lea	eax, [esp+1Ch+var_C]
push	eax
push	offset flt_7E099A8
push	offset flt_7E0999C
push	offset flt_7E09990
call	sub_43FC50
lea	ecx, [esp+2Ch+var_C]
push	1				; char
push	ecx				; float
push	offset flt_7E099B4		; int
push	offset flt_7E099A8		; int
push	offset flt_7E0999C		; int
push	offset flt_7E09990		; int
push	3				; int
push	offset byte_81C164C		; float
push	offset flt_81C17BC		; float
call	sub_44F660
mov	bl, al
add	esp, 34h
test	bl, bl
jnz	short loc_43D9C4
lea	edx, [esp+1Ch+var_C]
push	edx
push	offset flt_7E099B4
push	offset flt_7E099A8
push	offset flt_7E09990
call	sub_43FC50
lea	eax, [esp+2Ch+var_C]
push	1				; char
push	eax				; float
push	offset flt_7E0999C		; int
push	offset flt_7E099B4		; int
push	offset flt_7E099A8		; int
push	offset flt_7E09990		; int
push	3				; int
push	offset byte_81C164C		; float
push	offset flt_81C17BC		; float
call	sub_44F660
add	esp, 34h
mov	bl, al

loc_43D9C4:				; CODE XREF: sub_43D7D0+1A8j
cmp	bl, 1
jnz	short loc_43D9E3
mov	ecx, [esp+1Ch+arg_0]
mov	edx, [esp+1Ch+arg_4]
mov	byte_7CC9934, bl
mov	dword ptr flt_7EC99C0, ecx
mov	dword ptr flt_7EC99C4, edx

loc_43D9E3:				; CODE XREF: sub_43D7D0+1F7j
cmp	dword ptr dword_7C41CC0, 3
jnz	loc_43DA7D
mov	eax, dword ptr dword_7C41CD4
test	eax, eax
jnz	short loc_43DA16
mov	eax, dword ptr dword_7CC9924
mov	cl, byte_81AA364[eax]
and	cl, 4
cmp	cl, 4
jz	short loc_43DA2D
pop	ebp
pop	edi
mov	al, bl
pop	esi
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_43DA16:				; CODE XREF: sub_43D7D0+227j
cmp	eax, 2
jnz	short loc_43DA7D
mov	edx, dword ptr dword_7CC9924
mov	al, byte_81AA364[edx]
and	al, 1
cmp	al, 1
jnz	short loc_43DA7D

loc_43DA2D:				; CODE XREF: sub_43D7D0+23Aj
call	sub_44E0E0
push	1
call	sub_44E240
add	esp, 4
call	sub_44E180
push	6				; mode
call	ebp ; glBegin
push	3E99999Ah			; alpha
push	3F000000h			; blue
push	3F000000h			; green
push	3F800000h			; red
call	ds:glColor4f
mov	esi, offset flt_7E09990

loc_43DA64:				; CODE XREF: sub_43D7D0+2A0j
push	esi				; v
call	edi ; glVertex3fv
add	esi, 0Ch
cmp	esi, offset byte_7E099C0
jl	short loc_43DA64
call	ds:glEnd
call	sub_44E1C0

loc_43DA7D:				; CODE XREF: sub_43D7D0+21Aj
					; sub_43D7D0+249j ...
pop	ebp
pop	edi
mov	al, bl
pop	esi
pop	ebx
add	esp, 0Ch
retn
sub_43D7D0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43DA90(float,	int, int, int, int, int)
sub_43DA90 proc	near			; CODE XREF: sub_43ED40+B7p

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_14=	dword ptr  18h

push	ebx
push	ebp
mov	ecx, [esp+8+arg_14]
push	esi
mov	esi, [esp+0Ch+arg_C]
push	edi
mov	edi, [esp+10h+arg_8]
mov	eax, esi
fld	[esp+10h+arg_0]
fmul	dword ptr flt_4787B4
shl	eax, 8
fld	[esp+10h+arg_4]
add	eax, edi
push	1				; int
fmul	dword ptr flt_4787B4
mov	edx, eax
lea	ebx, [eax+ecx]
lea	eax, [esi+ecx]
mov	dword ptr dword_7CC9924, edx
shl	eax, 8
add	eax, edi
mov	dword ptr dword_7CC9928, ebx
add	ecx, eax
mov	ebp, eax
mov	eax, dword ptr dword_81BA37C
mov	dword ptr dword_7CC992C, ecx
fld	st(1)
shl	eax, 12h
fstp	dword ptr flt_7E09990
add	eax, offset byte_7F69A18
mov	dword ptr dword_7CC9930, ebp
fst	dword ptr flt_7E09994
fild	dword ptr [eax+edx*4]
mov	edx, [esp+14h+arg_4]
push	1				; float
push	edx				; int
fadd	dword ptr flt_4789B0
fstp	dword ptr flt_7E09998
fld	st(1)
fadd	dword ptr flt_4787B4
fst	dword ptr flt_7E0999C
fld	st(1)
fstp	dword ptr flt_7E099A0
fild	dword ptr [eax+ebx*4]
fadd	dword ptr flt_4789B0
fstp	dword ptr flt_7E099A4
fstp	dword ptr flt_7E099A8
fadd	dword ptr flt_4787B4
fst	[esp+1Ch+arg_C]
fstp	dword ptr flt_7E099AC
fild	dword ptr [eax+ecx*4]
mov	ecx, [esp+1Ch+arg_C]
mov	dword ptr dword_7E099B8, ecx
fadd	dword ptr flt_4789B0
fstp	dword ptr flt_7E099B0
fstp	dword ptr flt_7E099B4
fild	dword ptr [eax+ebp*4]
mov	eax, [esp+1Ch+arg_0]
push	eax				; float
push	5				; float
fadd	dword ptr flt_4789B0
fstp	dword ptr flt_7E099BC
call	sub_43D170
push	esi
push	edi
push	5
call	sub_43CE10
add	esp, 20h
xor	al, al
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_43DA90 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43DBA0 proc	near			; CODE XREF: sub_43DDE0+1CEp
					; sub_43E010+2A5p

v= dword ptr -30h
green= dword ptr -2Ch
blue= dword ptr	-28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
arg_14=	byte ptr  18h
alpha= dword ptr  1Ch

fld	[esp+arg_0]
sub	esp, 30h
push	edi
call	__ftol
fld	[esp+34h+arg_4]
mov	edi, eax
call	__ftol
test	edi, edi
jl	loc_43DDD3
test	eax, eax
jl	loc_43DDD3
cmp	edi, 0FFh
jge	loc_43DDD3
cmp	eax, 0FFh
jge	loc_43DDD3
fld	[esp+34h+arg_8]
fmul	dword ptr flt_4786CC
mov	ecx, eax
push	ebx				; t
shl	ecx, 8
add	ecx, edi
push	ebp				; v
fstp	[esp+3Ch+arg_8]
fld	[esp+3Ch+arg_0]
fmul	dword ptr flt_4786CC
fld	[esp+3Ch+arg_4]
fmul	dword ptr flt_4786CC
fld	st(1)
push	esi
mov	esi, [esp+40h+arg_C]
fstp	dword ptr flt_7E09990
lea	edx, [ecx+esi]
add	eax, esi
fst	dword ptr flt_7E09994
fld dword ptr flt_7EE9A04[ecx*4]
shl	eax, 8
fstp	dword ptr flt_7E09998
fld	st(1)
fadd	[esp+40h+arg_8]
add	edi, eax
mov	dword ptr dword_7CC9924, ecx
add	esi, edi
mov	dword ptr dword_7CC9928, edx
mov	dword ptr dword_7CC992C, esi
mov	dword ptr dword_7CC9930, edi
fst	dword ptr flt_7E0999C
fld	st(1)
fstp	dword ptr flt_7E099A0
fld dword ptr flt_7EE9A04[edx*4]
fstp	dword ptr flt_7E099A4
fstp	dword ptr flt_7E099A8
fadd	[esp+40h+arg_8]
fst	[esp+40h+arg_0]
fstp	dword ptr flt_7E099AC
fld dword ptr flt_7EE9A04[esi*4]
mov	eax, [esp+40h+arg_0]
fstp	dword ptr flt_7E099B0
mov	dword ptr dword_7E099B8, eax
mov	al, [esp+40h+arg_14]
fstp	dword ptr flt_7E099B4
fld dword ptr flt_7EE9A04[edi*4]
test	al, al
fstp	dword ptr flt_7E099BC
jz	loc_43DD48
lea	eax, [ecx+ecx*2]
shl	eax, 2
mov	ecx, dword ptr dword_7FE9D40[eax]
mov	[esp+40h+v], ecx
mov	ecx, dword ptr dword_7FE9D44[eax]
mov	eax, dword ptr dword_7FE9D48[eax]
mov	[esp+40h+green], ecx
mov	[esp+40h+blue],	eax
lea	eax, [edx+edx*2]
shl	eax, 2
mov	ecx, dword ptr dword_7FE9D40[eax]
mov	edx, dword ptr dword_7FE9D44[eax]
mov	eax, dword ptr dword_7FE9D48[eax]
mov	[esp+40h+var_24], ecx
mov	[esp+40h+var_1C], eax
lea	eax, [esi+esi*2]
shl	eax, 2
mov	[esp+40h+var_20], edx
mov	ecx, dword ptr dword_7FE9D40[eax]
mov	edx, dword ptr dword_7FE9D44[eax]
mov	eax, dword ptr dword_7FE9D48[eax]
mov	[esp+40h+var_18], ecx
mov	[esp+40h+var_10], eax
lea	eax, [edi+edi*2]
shl	eax, 2
mov	[esp+40h+var_14], edx
mov	ecx, dword ptr dword_7FE9D40[eax]
mov	edx, dword ptr dword_7FE9D44[eax]
mov	eax, dword ptr dword_7FE9D48[eax]
mov	[esp+40h+var_C], ecx
mov	[esp+40h+var_8], edx
mov	[esp+40h+var_4], eax

loc_43DD48:				; CODE XREF: sub_43DBA0+112j
push	6				; mode
call	ds:glBegin
mov	edi, [esp+40h+arg_10]
mov	ebp, ds:glTexCoord2f
mov	ebx, ds:glVertex3fv
lea	ecx, [esp+40h+v]
sub	edi, ecx
xor	esi, esi

loc_43DD68:				; CODE XREF: sub_43DBA0+228j
mov	al, [esp+40h+arg_14]
test	al, al
jz	short loc_43DDA8
fld	[esp+40h+alpha]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 40h
jz	short loc_43DD8E
lea	edx, [esp+esi+40h+v]
push	edx				; v
call	ds:glColor3fv
jmp	short loc_43DDA8
; ---------------------------------------------------------------------------

loc_43DD8E:				; CODE XREF: sub_43DBA0+1DFj
mov	eax, [esp+40h+alpha]
mov	ecx, [esp+esi+40h+blue]
mov	edx, [esp+esi+40h+green]
push	eax				; alpha
mov	eax, [esp+esi+44h+v]
push	ecx				; blue
push	edx				; green
push	eax				; red
call	ds:glColor4f

loc_43DDA8:				; CODE XREF: sub_43DBA0+1CEj
					; sub_43DBA0+1ECj
lea	ecx, [edi+esi]
mov	edx, [esp+ecx+40h+green]
lea	eax, [esp+ecx+40h+v]
push	edx				; t
mov	eax, [eax]
push	eax				; s
call	ebp ; glTexCoord2f
lea	ecx, dword ptr flt_7E09990[esi]
push	ecx				; v
call	ebx ; glVertex3fv
add	esi, 0Ch
cmp	esi, 30h
jl	short loc_43DD68
call	ds:glEnd
pop	esi
pop	ebp
pop	ebx

loc_43DDD3:				; CODE XREF: sub_43DBA0+1Aj
					; sub_43DBA0+22j ...
pop	edi
add	esp, 30h
retn
sub_43DBA0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43DDE0(GLuint	texture, int, int, int)
sub_43DDE0 proc	near			; CODE XREF: sub_43C270+32p

var_E0=	dword ptr -0E0h
var_DC=	dword ptr -0DCh
var_B8=	dword ptr -0B8h
var_B4=	dword ptr -0B4h
var_B0=	dword ptr -0B0h
var_AC=	dword ptr -0ACh
var_A8=	dword ptr -0A8h
var_A4=	dword ptr -0A4h
var_A0=	dword ptr -0A0h
var_9C=	dword ptr -9Ch
var_98=	dword ptr -98h
var_94=	dword ptr -94h
var_90=	dword ptr -90h
var_8C=	dword ptr -8Ch
var_88=	dword ptr -88h
var_84=	dword ptr -84h
var_80=	dword ptr -80h
var_7C=	dword ptr -7Ch
var_78=	dword ptr -78h
var_74=	dword ptr -74h
var_70=	dword ptr -70h
var_6C=	dword ptr -6Ch
var_68=	dword ptr -68h
var_64=	dword ptr -64h
var_60=	byte ptr -60h
var_30=	byte ptr -30h
texture= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 0B8h
push	ebx
push	esi
push	3F800000h			; blue
push	3F800000h			; green
push	3F800000h			; red
call	ds:glColor3f
mov	eax, [esp+0C0h+arg_C]
lea	ecx, [esp+0C0h+var_30]
lea	edx, [esp+0C0h+var_9C]
push	ecx
push	edx
mov	[esp+0C8h+var_9C], 0
mov	[esp+0C8h+var_98], 0
mov	[esp+0C8h+var_94], eax
call	sub_43F530
mov	esi, [esp+0C8h+texture]
push	esi				; texture
call	sub_44E0A0
fld	dword ptr flt_4789C4
lea	ebx, [esi+esi*2]
add	esp, 0Ch
shl	ebx, 4
add	ebx, offset byte_81C49B0
mov	[esp+0C0h+var_B8], 0
fdiv	dword ptr [ebx+20h]
fstp	[esp+0C0h+var_A0]
fld	dword ptr flt_4789C4
fdiv	dword ptr [ebx+24h]
fstp	[esp+0C0h+var_A8]
fld	dword ptr [ebx+24h]
fmul	dword ptr flt_47891C
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	loc_43DFFD
push	edi

loc_43DE83:				; CODE XREF: sub_43DDE0+216j
fld	dword ptr [ebx+20h]
fmul	dword ptr flt_47891C
mov	[esp+0C4h+var_B4], 0
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 41h
jnz	loc_43DFD6
fld	[esp+0C4h+var_B8]
fmul	[esp+0C4h+var_A8]
fstp	[esp+0C4h+var_A4]
fld	[esp+0C4h+var_B8]
fadd	dword ptr flt_4786B8
fmul	[esp+0C4h+var_A8]
fstp	[esp+0C4h+var_B0]

loc_43DEC3:				; CODE XREF: sub_43DDE0+1F0j
fld	[esp+0C4h+var_B4]
fmul	[esp+0C4h+var_A0]
mov	eax, [esp+0C4h+var_A4]
mov	edx, [esp+0C4h+var_B0]
mov	[esp+0C4h+var_8C], eax
mov	ecx, eax
mov	eax, edx
mov	[esp+0C4h+var_88], 0
fst	[esp+0C4h+var_90]
fld	[esp+0C4h+var_B4]
fadd	dword ptr flt_4786B8
mov	[esp+0C4h+var_80], ecx
mov	[esp+0C4h+var_7C], 0
mov	[esp+0C4h+var_74], edx
mov	[esp+0C4h+var_70], 0
mov	[esp+0C4h+var_68], eax
mov	[esp+0C4h+var_64], 0
fst	[esp+0C4h+var_AC]
fmul	[esp+0C4h+var_A0]
xor	esi, esi
fst	[esp+0C4h+var_84]
fstp	[esp+0C4h+var_78]
fstp	[esp+0C4h+var_6C]

loc_43DF2B:				; CODE XREF: sub_43DDE0+19Bj
fld	[esp+esi+0C4h+var_90]
fsub	dword ptr flt_4786E0
lea	eax, [esp+esi+0C4h+var_90]
lea	edi, [esp+esi+0C4h+var_60]
lea	ecx, [esp+0C4h+var_30]
push	edi
push	ecx
push	eax
fstp	dword ptr [eax]
fld	dword ptr [eax+4]
fsub	dword ptr flt_4786E0
fstp	dword ptr [eax+4]
call	sub_43F830
fld	dword ptr [edi]
fadd	dword ptr flt_4786E0
add	esi, 0Ch
add	esp, 0Ch
cmp	esi, 30h
fstp	dword ptr [edi]
fld	[esp+esi+0C4h+var_68]
fadd	dword ptr flt_4786E0
fstp	[esp+esi+0C4h+var_68]
jl	short loc_43DF2B
fild	[esp+0C4h+arg_8]
push	3F800000h
lea	edx, [esp+0C8h+var_60]
push	1
push	edx
fadd	[esp+0D0h+var_B8]
push	1
push	3F800000h
push	ecx
fstp	[esp+0DCh+var_DC]
fild	[esp+0DCh+arg_4]
push	ecx
fadd	[esp+0E0h+var_B4]
fstp	[esp+0E0h+var_E0]
call	sub_43DBA0
fld	dword ptr [ebx+20h]
mov	eax, [esp+0E0h+var_AC]
add	esp, 1Ch
fmul	dword ptr flt_47891C
mov	[esp+0C4h+var_B4], eax
fcomp	[esp+0C4h+var_B4]
fnstsw	ax
test	ah, 41h
jz	loc_43DEC3

loc_43DFD6:				; CODE XREF: sub_43DDE0+BFj
fld	[esp+0C4h+var_B8]
fadd	dword ptr flt_4786B8
fstp	[esp+0C4h+var_B8]
fld	dword ptr [ebx+24h]
fmul	dword ptr flt_47891C
fcomp	[esp+0C4h+var_B8]
fnstsw	ax
test	ah, 41h
jz	loc_43DE83
pop	edi

loc_43DFFD:				; CODE XREF: sub_43DDE0+9Cj
pop	esi
pop	ebx
add	esp, 0B8h
retn
sub_43DDE0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43E010(GLuint	texture, float,	float, float, float, GLfloat *v, int, GLfloat alpha)
sub_43E010 proc	near			; CODE XREF: sub_41BD30+5Dp
					; sub_420EF0:loc_4211BCp ...

var_FC=	dword ptr -0FCh
var_F8=	dword ptr -0F8h
var_D4=	dword ptr -0D4h
var_D0=	dword ptr -0D0h
var_CC=	dword ptr -0CCh
var_C8=	dword ptr -0C8h
var_C4=	dword ptr -0C4h
var_C0=	dword ptr -0C0h
var_BC=	dword ptr -0BCh
var_B8=	dword ptr -0B8h
var_B4=	dword ptr -0B4h
var_B0=	dword ptr -0B0h
var_AC=	dword ptr -0ACh
var_A8=	dword ptr -0A8h
var_A4=	dword ptr -0A4h
var_A0=	dword ptr -0A0h
var_9C=	dword ptr -9Ch
var_98=	dword ptr -98h
var_94=	dword ptr -94h
var_90=	dword ptr -90h
var_8C=	dword ptr -8Ch
var_88=	dword ptr -88h
var_84=	dword ptr -84h
var_80=	dword ptr -80h
var_7C=	dword ptr -7Ch
var_78=	dword ptr -78h
var_74=	dword ptr -74h
var_70=	dword ptr -70h
var_6C=	dword ptr -6Ch
var_68=	dword ptr -68h
var_64=	dword ptr -64h
var_60=	byte ptr -60h
var_30=	byte ptr -30h
texture= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h
v= dword ptr  18h
arg_18=	dword ptr  1Ch
alpha= dword ptr  20h

fld	[esp+alpha]
fcomp	dword ptr flt_4786B8
sub	esp, 0D4h
push	ebx
mov	ebx, [esp+0D8h+alpha]
fnstsw	ax
test	ah, 40h
jz	short loc_43E03F
mov	eax, [esp+0D8h+v]
push	eax				; v
call	ds:glColor3fv
jmp	short loc_43E058
; ---------------------------------------------------------------------------

loc_43E03F:				; CODE XREF: sub_43E010+1Dj
mov	eax, [esp+0D8h+v]
push	ebx				; alpha
mov	ecx, [eax+8]
mov	edx, [eax+4]
mov	eax, [eax]
push	ecx				; blue
push	edx				; green
push	eax				; red
call	ds:glColor4f

loc_43E058:				; CODE XREF: sub_43E010+2Dj
mov	ecx, [esp+0D8h+arg_18]
lea	edx, [esp+0D8h+var_30]
lea	eax, [esp+0D8h+var_9C]
push	edx
push	eax
mov	[esp+0E0h+var_9C], 0
mov	[esp+0E0h+var_98], 0
mov	[esp+0E0h+var_94], ecx
call	sub_43F530
mov	ecx, [esp+0E0h+texture]
push	ecx				; texture
call	sub_44E0A0
fld	[esp+0E4h+arg_4]
fmul	dword ptr flt_478770
add	esp, 0Ch
fstp	[esp+0D8h+var_CC]
fld	[esp+0D8h+arg_8]
fmul	dword ptr flt_478770
fstp	[esp+0D8h+var_D4]
fld	[esp+0D8h+var_CC]
call	__ftol
fld	[esp+0D8h+var_D4]
mov	[esp+0D8h+var_C0], eax
call	__ftol
fld	[esp+0D8h+arg_C]
fcomp	[esp+0D8h+arg_10]
mov	[esp+0D8h+var_BC], eax
fnstsw	ax
test	ah, 1
jnz	short loc_43E0EF
fld	[esp+0D8h+arg_C]
jmp	short loc_43E0F6
; ---------------------------------------------------------------------------

loc_43E0EF:				; CODE XREF: sub_43E010+D4j
fld	[esp+0D8h+arg_10]

loc_43E0F6:				; CODE XREF: sub_43E010+DDj
fild	[esp+0D8h+var_C0]
fstp	[esp+0D8h+var_C0]
fld	st
fmul	dword ptr flt_4786E0
fld	[esp+0D8h+var_C0]
fsub	[esp+0D8h+var_CC]
fadd	st, st(1)
fstp	[esp+0D8h+var_AC]
fild	[esp+0D8h+var_BC]
fst	[esp+0D8h+var_BC]
fsub	[esp+0D8h+var_D4]
fadd	st, st(1)
fstp	[esp+0D8h+var_A8]
fstp	st
fld	dword ptr flt_4786B8
fdiv	st, st(1)
fst	[esp+0D8h+var_B4]
fstp	[esp+0D8h+var_B0]
call	__ftol
inc	eax
mov	[esp+0D8h+var_C4], eax
fild	[esp+0D8h+var_C4]
fstp	[esp+0D8h+var_D4]
fld	[esp+0D8h+arg_C]
fdiv	[esp+0D8h+arg_10]
fstp	[esp+0D8h+var_A0]
fld	[esp+0D8h+var_D4]
fchs
fstp	[esp+0D8h+var_CC]
fld	[esp+0D8h+var_D4]
fcomp	[esp+0D8h+var_CC]
mov	edx, [esp+0D8h+var_CC]
mov	[esp+0D8h+var_C8], edx
fnstsw	ax
test	ah, 1
jnz	loc_43E2F9
push	esi
push	edi

loc_43E183:				; CODE XREF: sub_43E010+2E1j
mov	eax, [esp+0E0h+var_CC]
mov	[esp+0E0h+var_D0], eax
fld	[esp+0E0h+var_D0]
fcomp	[esp+0E0h+var_D4]
fnstsw	ax
test	ah, 41h
jz	loc_43E2DA
fld	[esp+0E0h+var_C8]
fadd	[esp+0E0h+var_A8]
fld	st
fmul	[esp+0E0h+var_B0]
fstp	[esp+0E0h+var_B8]
fld	[esp+0E0h+var_AC]
fadd	dword ptr flt_4786B8
fstp	[esp+0E0h+var_A4]
fadd	dword ptr flt_4786B8
fmul	[esp+0E0h+var_B0]
fstp	[esp+0E0h+var_C4]

loc_43E1CC:				; CODE XREF: sub_43E010+2C4j
fld	[esp+0E0h+var_D0]
fadd	[esp+0E0h+var_AC]
mov	ecx, [esp+0E0h+var_B8]
mov	eax, [esp+0E0h+var_C4]
mov	[esp+0E0h+var_8C], ecx
mov	edx, ecx
fmul	[esp+0E0h+var_B4]
mov	ecx, eax
mov	[esp+0E0h+var_88], 0
mov	[esp+0E0h+var_80], edx
mov	[esp+0E0h+var_7C], 0
mov	[esp+0E0h+var_74], eax
mov	[esp+0E0h+var_70], 0
fst	[esp+0E0h+var_90]
fld	[esp+0E0h+var_A4]
fadd	[esp+0E0h+var_D0]
mov	[esp+0E0h+var_68], ecx
mov	[esp+0E0h+var_64], 0
xor	esi, esi
fmul	[esp+0E0h+var_B4]
fst	[esp+0E0h+var_84]
fstp	[esp+0E0h+var_78]
fstp	[esp+0E0h+var_6C]

loc_43E232:				; CODE XREF: sub_43E010+279j
fld	[esp+esi+0E0h+var_90]
fsub	dword ptr flt_4786E0
lea	eax, [esp+esi+0E0h+var_90]
lea	edi, [esp+esi+0E0h+var_60]
lea	edx, [esp+0E0h+var_30]
push	edi
push	edx
push	eax
fstp	dword ptr [eax]
fld	dword ptr [eax+4]
fsub	dword ptr flt_4786E0
fstp	dword ptr [eax+4]
call	sub_43F830
fld	[esp+0ECh+var_A0]
fmul	dword ptr [edi]
add	esi, 0Ch
add	esp, 0Ch
cmp	esi, 30h
fadd	dword ptr flt_4786E0
fstp	dword ptr [edi]
fld	[esp+esi+0E0h+var_68]
fadd	dword ptr flt_4786E0
fstp	[esp+esi+0E0h+var_68]
jl	short loc_43E232
fld	[esp+0E0h+var_BC]
fadd	[esp+0E0h+var_C8]
push	ebx
lea	eax, [esp+0E4h+var_60]
push	0
push	eax
push	1
push	3F800000h
push	ecx
fstp	[esp+0F8h+var_F8]
fld	[esp+0F8h+var_C0]
fadd	[esp+0F8h+var_D0]
push	ecx
fstp	[esp+0FCh+var_FC]
call	sub_43DBA0
fld	[esp+0FCh+var_D0]
fadd	dword ptr flt_4786B8
add	esp, 1Ch
fst	[esp+0E0h+var_D0]
fcomp	[esp+0E0h+var_D4]
fnstsw	ax
test	ah, 41h
jnz	loc_43E1CC

loc_43E2DA:				; CODE XREF: sub_43E010+188j
fld	[esp+0E0h+var_C8]
fadd	dword ptr flt_4786B8
fst	[esp+0E0h+var_C8]
fcomp	[esp+0E0h+var_D4]
fnstsw	ax
test	ah, 41h
jnz	loc_43E183
pop	edi
pop	esi

loc_43E2F9:				; CODE XREF: sub_43E010+16Bj
pop	ebx
add	esp, 0D4h
retn
sub_43E010 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43E310 proc	near			; CODE XREF: sub_43E4B0+541p

var_A0=	dword ptr -0A0h
var_9C=	dword ptr -9Ch
var_98=	dword ptr -98h
var_94=	dword ptr -94h
var_90=	dword ptr -90h
var_8C=	dword ptr -8Ch
var_88=	dword ptr -88h
var_84=	dword ptr -84h
var_80=	dword ptr -80h
var_7C=	dword ptr -7Ch
var_78=	dword ptr -78h
var_74=	dword ptr -74h
var_70=	dword ptr -70h
var_6C=	dword ptr -6Ch
var_68=	dword ptr -68h
var_64=	dword ptr -64h
var_60=	byte ptr -60h
var_30=	byte ptr -30h
arg_0= dword ptr  4

sub	esp, 0A0h
push	ebx
push	ebp
push	esi
push	edi
call	sub_4339F0
mov	[esp+0B0h+var_A0], eax
lea	ecx, [esp+0B0h+var_30]
fild	[esp+0B0h+var_A0]
lea	edx, [esp+0B0h+var_9C]
push	ecx
push	edx
mov	[esp+0B8h+var_8C], 449F0000h
fmul	dword ptr flt_4789D0
mov	[esp+0B8h+var_88], 0
mov	[esp+0B8h+var_80], 449F0000h
mov	[esp+0B8h+var_7C], 0
mov	[esp+0B8h+var_74], 0C4280000h
mov	[esp+0B8h+var_70], 0
mov	[esp+0B8h+var_68], 0C4280000h
fst	[esp+0B8h+var_A0]
fmul	dword ptr flt_4789CC
fld	[esp+0B8h+var_A0]
fmul	dword ptr flt_4789C8
mov	[esp+0B8h+var_64], 0
mov	[esp+0B8h+var_9C], 0
mov	[esp+0B8h+var_98], 0
mov	[esp+0B8h+var_94], 42340000h
fstp	[esp+0B8h+var_A0]
mov	eax, [esp+0B8h+var_A0]
fld	st
fchs
fstp	[esp+0B8h+var_90]
mov	[esp+0B8h+var_78], eax
fstp	[esp+0B8h+var_84]
fld	[esp+0B8h+var_A0]
fchs
fstp	[esp+0B8h+var_6C]
call	sub_43F530
mov	ebp, [esp+0B8h+arg_0]
add	esp, 8
xor	esi, esi
xor	ebx, ebx

loc_43E3DB:				; CODE XREF: sub_43E310+129j
lea	edi, [esp+esi+0B0h+var_60]
lea	eax, [esp+0B0h+var_30]
push	edi
lea	ecx, [esp+esi+0B4h+var_90]
push	eax
push	ecx
call	sub_43F830
fld	dword ptr [edi]
fadd	dword ptr [ebp+0]
add	esi, 0Ch
add	esp, 0Ch
add	ebx, 4
cmp	esi, 30h
fstp	dword ptr [edi]
fld	[esp+esi+0B0h+var_68]
fadd	dword ptr [ebp+4]
fstp	[esp+esi+0B0h+var_68]
fld	dword ptr [ebp+8]
fadd	[esp+esi+0B0h+var_64]
fstp	[esp+esi+0B0h+var_64]
fld	dword ptr [edi]
fmul	dword ptr flt_478754
fstp	dword ptr [ebx+flt_7D0994C+10h]
fld	[esp+esi+0B0h+var_68]
fmul	dword ptr flt_478754
fstp	dword ptr [ebx+flt_7D0994C]
jl	short loc_43E3DB
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0A0h
retn
sub_43E310 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43E450(float,	float, float)
sub_43E450 proc	near			; CODE XREF: sub_4164E0+29p
					; sub_43EBA0+3Cp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

cmp	dword ptr nScene_482904, 5
jnz	short loc_43E4A3
xor	ecx, ecx
mov	eax, 0Ch

loc_43E460:				; CODE XREF: sub_43E450+51j
fld	dword ptr [eax+flt_7D0994C+4]
fsub	[esp+arg_4]
fld	dword ptr [ecx+flt_7D0994C+14h]
fsub	[esp+arg_0]
fmulp	st(1), st
fld	dword ptr [eax+flt_7D0994C+14h]
fsub	[esp+arg_0]
fld	dword ptr [ecx+flt_7D0994C+4]
fsub	[esp+arg_4]
fmulp	st(1), st
fsubp	st(1), st
fcomp	[esp+arg_8]
fnstsw	ax
test	ah, 41h
jnz	short loc_43E4A6
mov	eax, ecx
add	ecx, 4
cmp	ecx, 10h
jl	short loc_43E460

loc_43E4A3:				; CODE XREF: sub_43E450+7j
mov	al, 1
retn
; ---------------------------------------------------------------------------

loc_43E4A6:				; CODE XREF: sub_43E450+47j
xor	al, al
retn
sub_43E450 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43E4B0(float)
sub_43E4B0 proc	near			; CODE XREF: sub_455510+4Ep

var_88=	dword ptr -88h
var_84=	dword ptr -84h
var_80=	dword ptr -80h
var_7C=	dword ptr -7Ch
var_78=	dword ptr -78h
var_74=	dword ptr -74h
var_70=	dword ptr -70h
var_6C=	dword ptr -6Ch
var_68=	dword ptr -68h
var_64=	dword ptr -64h
var_60=	dword ptr -60h
var_5C=	dword ptr -5Ch
var_58=	dword ptr -58h
var_54=	dword ptr -54h
var_50=	dword ptr -50h
var_4C=	dword ptr -4Ch
var_48=	dword ptr -48h
var_44=	dword ptr -44h
var_40=	dword ptr -40h
var_3C=	dword ptr -3Ch
var_38=	dword ptr -38h
var_34=	dword ptr -34h
var_30=	byte ptr -30h
arg_0= dword ptr  4

sub	esp, 88h
fld	dword ptr qword_4827B8+4
fmul	dword ptr flt_478844
push	ebx
push	ebp
push	esi
push	edi
mov	[esp+98h+var_6C], 0
mov	[esp+98h+var_68], 0
fstp	[esp+98h+var_88]
fld dword ptr flt_4827C0
fmul	dword ptr flt_4789DC
mov	[esp+98h+var_64], 0
mov	[esp+98h+var_7C], 46C80000h
fptan
fstp	st
fmul	[esp+98h+var_88]
fmul	[esp+98h+arg_0]
fadd	dword ptr flt_4786CC
fld	st
fmul	dword ptr flt_478868
fst	[esp+98h+var_80]
fld	st(1)
fchs
fst	[esp+98h+var_84]
fstp	[esp+98h+var_60]
mov	edx, [esp+98h+var_84]
mov	[esp+98h+var_84], 46C80000h
fst	[esp+98h+var_5C]
fld	[esp+98h+var_88]
fchs
fst	[esp+98h+var_88]
fstp	[esp+98h+var_58]
fld	st(1)
mov	eax, [esp+98h+var_88]
mov	[esp+98h+var_3C], edx
fstp	[esp+98h+var_54]
mov	ecx, eax
mov	[esp+98h+var_4C], eax
fstp	[esp+98h+var_50]
mov	[esp+98h+var_40], ecx
lea	ecx, [esp+98h+var_30]
fstp	[esp+98h+var_48]
fld	[esp+98h+var_80]
fchs
fst	[esp+98h+var_44]
fstp	[esp+98h+var_38]
push	ecx
mov	[esp+9Ch+var_34], eax
mov	[esp+9Ch+var_80], 0
mov	[esp+9Ch+var_88], 0
call	sub_44DDF0
add	esp, 4
xor	esi, esi

loc_43E592:				; CODE XREF: sub_43E4B0+19Bj
lea	edx, [esp+98h+var_78]
lea	eax, [esp+98h+var_30]
push	edx
lea	ecx, [esp+esi+9Ch+var_6C]
push	eax
push	ecx
call	sub_43F890
fld dword ptr flt_81C1808
fadd	[esp+0A4h+var_78]
add	esp, 0Ch
fstp	dword ptr [esi+dword_7CC98E8]
fld dword ptr flt_81C180C
fadd	[esp+98h+var_74]
fstp	dword ptr [esi+dword_7CC98EC]
fld dword ptr flt_81C1810
fadd	[esp+98h+var_70]
fstp	dword ptr [esi+flt_7CC98F0]
fld	[esp+98h+var_7C]
fcomp	dword ptr [esi+dword_7CC98E8]
fnstsw	ax
test	ah, 41h
jnz	short loc_43E5F4
mov	edx, dword ptr dword_7CC98E8[esi]
mov	[esp+98h+var_7C], edx

loc_43E5F4:				; CODE XREF: sub_43E4B0+138j
fld	[esp+98h+var_84]
fcomp	dword ptr [esi+dword_7CC98EC]
fnstsw	ax
test	ah, 41h
jnz	short loc_43E60F
mov	eax, dword ptr dword_7CC98EC[esi]
mov	[esp+98h+var_84], eax

loc_43E60F:				; CODE XREF: sub_43E4B0+153j
fld	[esp+98h+var_80]
fcomp	dword ptr [esi+dword_7CC98E8]
fnstsw	ax
test	ah, 1
jz	short loc_43E62A
mov	ecx, dword ptr dword_7CC98E8[esi]
mov	[esp+98h+var_80], ecx

loc_43E62A:				; CODE XREF: sub_43E4B0+16Ej
fld	[esp+98h+var_88]
fcomp	dword ptr [esi+dword_7CC98EC]
fnstsw	ax
test	ah, 1
jz	short loc_43E645
mov	edx, dword ptr dword_7CC98EC[esi]
mov	[esp+98h+var_88], edx

loc_43E645:				; CODE XREF: sub_43E4B0+189j
add	esi, 0Ch
cmp	esi, 3Ch
jl	loc_43E592
fld	[esp+98h+var_7C]
fmul	dword ptr flt_4789D8
call	__ftol
cdq
fld	[esp+98h+var_84]
fmul	dword ptr flt_4789D8
and	edx, 3
mov	esi, 0FFFFFFFCh
add	eax, edx
sar	eax, 2
shl	eax, 2
sub	esi, eax
mov	dword ptr dword_81BA384, esi
call	__ftol
cdq
fld	[esp+98h+var_80]
fmul	dword ptr flt_4789D8
and	edx, 3
mov	edi, 0FFFFFFFCh
add	eax, edx
sar	eax, 2
shl	eax, 2
sub	edi, eax
mov	dword ptr dword_81BA388, edi
call	__ftol
cdq
fld	[esp+98h+var_88]
and	edx, 3
mov	ebx, 4
add	eax, edx
fmul	dword ptr flt_4789D8
sar	eax, 2
neg	eax
neg	eax
shl	eax, 2
sub	ebx, eax
mov	dword ptr dword_47D510, ebx
call	__ftol
cdq
fld	[esp+98h+var_7C]
and	edx, 3
mov	ebp, 4
add	eax, edx
fmul	dword ptr flt_4789D4
sar	eax, 2
neg	eax
neg	eax
shl	eax, 2
sub	ebp, eax
mov	dword ptr dword_47D514, ebp
call	__ftol
cdq
fld	[esp+98h+var_84]
and	edx, 3
add	eax, edx
fmul	dword ptr flt_4789D4
sar	eax, 2
shl	eax, 2
mov	ecx, eax
mov	eax, 0FFFFFFFCh
sub	eax, ecx
mov	dword ptr dword_81BA38C, eax
call	__ftol
cdq
fld	[esp+98h+var_80]
and	edx, 3
add	eax, edx
fmul	dword ptr flt_4789D4
sar	eax, 2
shl	eax, 2
mov	edx, eax
mov	eax, 0FFFFFFFCh
sub	eax, edx
mov	dword ptr dword_81BA390, eax
call	__ftol
cdq
and	edx, 3
add	eax, edx
sar	eax, 2
neg	eax
neg	eax
fld	[esp+98h+var_88]
fmul	dword ptr flt_4789D4
shl	eax, 2
mov	ecx, eax
mov	eax, 4
sub	eax, ecx
mov	dword ptr dword_47D518, eax
call	__ftol
cdq
and	edx, 3
xor	ecx, ecx
add	eax, edx
sar	eax, 2
neg	eax
neg	eax
shl	eax, 2
mov	edx, eax
mov	eax, 4
sub	eax, edx
cmp	esi, ecx
mov	dword ptr dword_47D51C, eax
jge	short loc_43E7B3
xor	esi, esi
mov	dword ptr dword_81BA384, esi

loc_43E7B3:				; CODE XREF: sub_43E4B0+2F9j
cmp	edi, ecx
jge	short loc_43E7BF
xor	edi, edi
mov	dword ptr dword_81BA388, edi

loc_43E7BF:				; CODE XREF: sub_43E4B0+305j
cmp	ebx, ecx
jge	short loc_43E7CB
xor	ebx, ebx
mov	dword ptr dword_47D510, ebx

loc_43E7CB:				; CODE XREF: sub_43E4B0+311j
cmp	ebp, ecx
jge	short loc_43E7D7
xor	ebp, ebp
mov	dword ptr dword_47D514, ebp

loc_43E7D7:				; CODE XREF: sub_43E4B0+31Dj
cmp	dword ptr dword_81BA38C, ecx
jge	short loc_43E7E5
mov	dword ptr dword_81BA38C, ecx

loc_43E7E5:				; CODE XREF: sub_43E4B0+32Dj
cmp	dword ptr dword_81BA390, ecx
jge	short loc_43E7F3
mov	dword ptr dword_81BA390, ecx

loc_43E7F3:				; CODE XREF: sub_43E4B0+33Bj
cmp	dword ptr dword_47D518, ecx
jge	short loc_43E801
mov	dword ptr dword_47D518, ecx

loc_43E801:				; CODE XREF: sub_43E4B0+349j
cmp	eax, ecx
jge	short loc_43E80C
xor	eax, eax
mov	dword ptr dword_47D51C, eax

loc_43E80C:				; CODE XREF: sub_43E4B0+353j
mov	ecx, 0FBh
cmp	esi, ecx
jle	short loc_43E81B
mov	dword ptr dword_81BA384, ecx

loc_43E81B:				; CODE XREF: sub_43E4B0+363j
cmp	edi, ecx
jle	short loc_43E825
mov	dword ptr dword_81BA388, ecx

loc_43E825:				; CODE XREF: sub_43E4B0+36Dj
cmp	ebx, ecx
jle	short loc_43E82F
mov	dword ptr dword_47D510, ecx

loc_43E82F:				; CODE XREF: sub_43E4B0+377j
pop	edi
pop	esi
cmp	ebp, ecx
pop	ebp
pop	ebx
jle	short loc_43E83D
mov	dword ptr dword_47D514, ecx

loc_43E83D:				; CODE XREF: sub_43E4B0+385j
mov	edx, dword ptr dword_81BA38C
mov	ecx, 0EFh
cmp	edx, ecx
jle	short loc_43E852
mov	dword ptr dword_81BA38C, ecx

loc_43E852:				; CODE XREF: sub_43E4B0+39Aj
cmp	dword ptr dword_81BA390, ecx
jle	short loc_43E860
mov	dword ptr dword_81BA390, ecx

loc_43E860:				; CODE XREF: sub_43E4B0+3A8j
cmp	dword ptr dword_47D518, ecx
jle	short loc_43E86E
mov	dword ptr dword_47D518, ecx

loc_43E86E:				; CODE XREF: sub_43E4B0+3B6j
cmp	eax, ecx
jle	short loc_43E878
mov	dword ptr dword_47D51C, ecx

loc_43E878:				; CODE XREF: sub_43E4B0+3C0j
push	offset flt_81A9EB8
push	offset byte_7CC9900
push	offset flt_7CC98F4
push	offset dword_7CC98E8
call	sub_43FC50
push	offset flt_81A9EC4
push	offset byte_7CC990C
push	offset byte_7CC9900
push	offset dword_7CC98E8
call	sub_43FC50
push	offset flt_81A9ED0
push	offset byte_7CC9918
push	offset byte_7CC990C
push	offset dword_7CC98E8
call	sub_43FC50
push	offset flt_81A9EDC
push	offset flt_7CC98F4
push	offset byte_7CC9918
push	offset dword_7CC98E8
call	sub_43FC50
add	esp, 40h
push	offset flt_81A9EE8
push	offset flt_7CC98F4
push	offset byte_7CC9900
push	offset byte_7CC990C
call	sub_43FC50
fld dword ptr flt_81A9EC0
fmul	dword ptr flt_7CC98F0
fld dword ptr flt_81A9EBC
fmul	dword ptr dword_7CC98EC
faddp	st(1), st
fld dword ptr flt_81A9EB8
fmul	dword ptr dword_7CC98E8
faddp	st(1), st
fchs
fstp	dword ptr flt_7D09938
fld dword ptr flt_81A9ECC
fmul	dword ptr flt_7CC98F0
fld dword ptr flt_81A9EC8
fmul	dword ptr dword_7CC98EC
faddp	st(1), st
fld dword ptr flt_81A9EC4
fmul	dword ptr dword_7CC98E8
faddp	st(1), st
fchs
fstp	dword ptr flt_7D0993C
fld dword ptr flt_81A9ED8
fmul	dword ptr flt_7CC98F0
fld dword ptr flt_81A9ED4
fmul	dword ptr dword_7CC98EC
faddp	st(1), st
fld dword ptr flt_81A9ED0
fmul	dword ptr dword_7CC98E8
faddp	st(1), st
fchs
fstp	dword ptr flt_7D09940
fld dword ptr flt_81A9EE4
fmul	dword ptr flt_7CC98F0
fld dword ptr flt_81A9EE0
fmul	dword ptr dword_7CC98EC
faddp	st(1), st
fld dword ptr flt_81A9EDC
fmul	dword ptr dword_7CC98E8
faddp	st(1), st
fchs
fstp	dword ptr flt_7D09944
fld dword ptr flt_81A9EF0
fmul	dword ptr flt_7CC98FC
fld dword ptr flt_81A9EEC
fmul	dword ptr flt_7CC98F8
faddp	st(1), st
fld dword ptr flt_81A9EE8
fmul	dword ptr flt_7CC98F4
faddp	st(1), st
fchs
fstp	dword ptr flt_7D09948
mov	eax, dword ptr dword_79DBE88
add	eax, 0Ch
push	eax
call	sub_43E310
add	esp, 9Ch
retn
sub_43E4B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43EA00(int, float)
sub_43EA00 proc	near			; CODE XREF: sub_420DE0+23p
					; sub_4452D0+37p

arg_0= dword ptr  4
arg_4= dword ptr  8

fld	[esp+arg_4]
push	esi
mov	esi, [esp+4+arg_0]
fchs
fstp	[esp+4+arg_0]
mov	edx, offset flt_7D09938
mov	ecx, offset flt_81A9EBC

loc_43EA19:				; CODE XREF: sub_43EA00+46j
fld	dword ptr [ecx-4]
fmul	dword ptr [esi]
fld	dword ptr [ecx+4]
fmul	dword ptr [esi+8]
faddp	st(1), st
fld	dword ptr [ecx]
fmul	dword ptr [esi+4]
faddp	st(1), st
fadd	dword ptr [edx]
fcomp	[esp+4+arg_0]
fnstsw	ax
test	ah, 1
jnz	short loc_43EA4C
add	ecx, 0Ch
add	edx, 4
cmp	ecx, offset byte_81A9EF8
jl	short loc_43EA19
mov	al, 1
pop	esi
retn
; ---------------------------------------------------------------------------

loc_43EA4C:				; CODE XREF: sub_43EA00+38j
xor	al, al
pop	esi
retn
sub_43EA00 endp


; =============== S U B	R O U T	I N E =======================================


sub_43EA50 proc	near			; CODE XREF: sub_455310+CFp

var_4= dword ptr -4

push	ecx
mov	eax, dword ptr dword_47D514
push	ebx
push	ebp
mov	ebp, dword ptr dword_81BA388
push	esi
push	edi
mov	ebx, ebp
lea	edi, [eax+3]
cmp	ebx, edi
jg	short loc_43EACA
mov	ecx, dword ptr dword_47D510
lea	esi, [ecx+3]

loc_43EA72:				; CODE XREF: sub_43EA50+78j
mov	ecx, dword ptr dword_81BA384
cmp	ecx, esi
jg	short loc_43EAC5
mov	edx, ebx
and	edx, 0FFh
shl	edx, 8

loc_43EA87:				; CODE XREF: sub_43EA50+6Dj
mov	eax, ecx
and	eax, 0FFh
add	eax, edx
lea	eax, [eax+eax*2]
shl	eax, 2
inc	ecx
mov	ebp, dword ptr dword_80A9D40[eax]
cmp	ecx, esi
mov	dword ptr dword_7FE9D40[eax], ebp
mov	ebp, dword ptr dword_80A9D44[eax]
mov	dword ptr dword_7FE9D44[eax], ebp
mov	ebp, dword ptr dword_80A9D48[eax]
mov	dword ptr dword_7FE9D48[eax], ebp
jle	short loc_43EA87
mov	ebp, dword ptr dword_81BA388

loc_43EAC5:				; CODE XREF: sub_43EA50+2Aj
inc	ebx
cmp	ebx, edi
jle	short loc_43EA72

loc_43EACA:				; CODE XREF: sub_43EA50+17j
mov	al, byte_81C152C
fld	dword ptr flt_5727448
test	al, al
jnz	short loc_43EAF6
call	__ftol
cdq
mov	ecx, 0AFC80h
idiv	ecx
mov	[esp+14h+var_4], edx
fild	[esp+14h+var_4]
fmul	dword ptr flt_4787E8
jmp	short loc_43EB11
; ---------------------------------------------------------------------------

loc_43EAF6:				; CODE XREF: sub_43EA50+87j
call	__ftol
cdq
mov	ecx, 8CA0h
idiv	ecx
mov	[esp+14h+var_4], edx
fild	[esp+14h+var_4]
fmul	dword ptr flt_478754

loc_43EB11:				; CODE XREF: sub_43EA50+A4j
cmp	ebp, edi
jg	short loc_43EB86
mov	edx, dword ptr dword_47D510
mov	esi, ebp
sub	edi, ebp
mov	ebp, dword ptr dword_81C1528
shl	esi, 8
lea	ebx, [edx+3]
inc	edi

loc_43EB2C:				; CODE XREF: sub_43EA50+134j
mov	ecx, dword ptr dword_81BA384
mov	[esp+14h+var_4], ecx
cmp	ecx, ebx
fild	[esp+14h+var_4]
jg	short loc_43EB7B
lea	eax, [esi+ecx]
lea	edx, flt_7CC9938[eax*4]
mov	eax, ebx
sub	eax, ecx
inc	eax

loc_43EB4D:				; CODE XREF: sub_43EA50+129j
cmp	ebp, 8
fld	st
jnz	short loc_43EB5C
fmul	dword ptr flt_4786D0
jmp	short loc_43EB62
; ---------------------------------------------------------------------------

loc_43EB5C:				; CODE XREF: sub_43EA50+102j
fmul	dword ptr flt_478764

loc_43EB62:				; CODE XREF: sub_43EA50+10Aj
fadd	st, st(2)
add	edx, 4
dec	eax
fsin
fmul	dword ptr flt_478788
fstp	dword ptr [edx-4]
fadd	dword ptr flt_4786B8
jnz	short loc_43EB4D

loc_43EB7B:				; CODE XREF: sub_43EA50+ECj
add	esi, 100h
dec	edi
fstp	st
jnz	short loc_43EB2C

loc_43EB86:				; CODE XREF: sub_43EA50+C3j
pop	edi
pop	esi
pop	ebp
pop	ebx
fstp	st
pop	ecx
retn
sub_43EA50 endp

; ---------------------------------------------------------------------------
align 10h
; [00000001 BYTES: COLLAPSED FUNCTION nullsub_2. PRESS KEYPAD CTRL-"+" TO EXPAND]
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43EBA0(int, float, int, float, int)
sub_43EBA0 proc	near			; CODE XREF: sub_43EC60+8Dp

var_20=	dword ptr -20h
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

push	ecx
push	ebx
push	ebp
mov	ebp, [esp+0Ch+arg_C]
push	esi
push	edi
xor	edi, edi

loc_43EBAB:				; CODE XREF: sub_43EBA0+A5j
fld	[esp+14h+arg_4]
fadd	dword ptr flt_4786E0
mov	eax, [esp+14h+arg_0]
mov	ebx, [esp+14h+arg_4]
mov	[esp+14h+var_4], eax
xor	esi, esi
fstp	[esp+14h+arg_C]

loc_43EBC7:				; CODE XREF: sub_43EBA0+89j
fld	[esp+14h+arg_0]
mov	ecx, [esp+14h+arg_C]
push	0				; float
fadd	dword ptr flt_4786E0
push	ecx				; float
push	ecx
fstp	[esp+20h+var_20]		; float
call	sub_43E450
add	esp, 0Ch
test	al, al
jnz	short loc_43EBF1
mov	al, byte_81C1815
test	al, al
jz	short loc_43EC17

loc_43EBF1:				; CODE XREF: sub_43EBA0+46j
mov	edx, [esp+14h+arg_10]
mov	ecx, [esp+14h+arg_8]
push	edx
push	1
lea	eax, [edi+ebp]
push	3F800000h
lea	edx, [esi+ecx]
push	eax
mov	eax, [esp+24h+arg_0]
push	edx
push	ebx
push	eax
call	sub_43D7D0
add	esp, 1Ch

loc_43EC17:				; CODE XREF: sub_43EBA0+4Fj
fld	[esp+14h+arg_0]
fadd	dword ptr flt_4786B8
inc	esi
cmp	esi, 4
fstp	[esp+14h+arg_0]
jl	short loc_43EBC7
fld	[esp+14h+arg_4]
fadd	dword ptr flt_4786B8
mov	ecx, [esp+14h+var_4]
inc	edi
cmp	edi, 4
mov	[esp+14h+arg_0], ecx
fstp	[esp+14h+arg_4]
jl	loc_43EBAB
pop	edi
pop	esi
pop	ebp
pop	ebx
pop	ecx
retn
sub_43EBA0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43EC60 proc	near			; CODE XREF: sub_43F220+C3p
					; sub_43F220+13Bp

var_24=	dword ptr -24h
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 8
mov	eax, dword ptr dword_47D514
push	edi
mov	edi, dword ptr dword_81BA388
mov	[esp+0Ch+var_8], edi
cmp	edi, eax
fild	[esp+0Ch+var_8]
fstp	[esp+0Ch+var_8]
jg	loc_43ED31
mov	eax, dword ptr dword_47D510
push	ebx
push	ebp
mov	ebp, [esp+14h+arg_0]
push	esi

loc_43EC8F:				; CODE XREF: sub_43EC60+C8j
mov	esi, dword ptr dword_81BA384
mov	[esp+18h+arg_0], esi
cmp	esi, eax
fild	[esp+18h+arg_0]
fstp	[esp+18h+arg_0]
jg	short loc_43ED0F
fld	[esp+18h+var_8]
fadd	dword ptr flt_4787B0
mov	ebx, [esp+18h+var_8]
fstp	[esp+18h+var_4]

loc_43ECB7:				; CODE XREF: sub_43EC60+ADj
fld	[esp+18h+arg_0]
mov	eax, [esp+18h+var_4]
push	0C2200000h			; float
fadd	dword ptr flt_4787B0
push	eax				; float
push	ecx
fstp	[esp+24h+var_24]		; float
call	sub_43E450
add	esp, 0Ch
test	al, al
jnz	short loc_43ECE4
mov	al, byte_81C1815
test	al, al
jz	short loc_43ECF5

loc_43ECE4:				; CODE XREF: sub_43EC60+79j
mov	ecx, [esp+18h+arg_0]
push	ebp				; int
push	edi				; float
push	esi				; int
push	ebx				; float
push	ecx				; int
call	sub_43EBA0
add	esp, 14h

loc_43ECF5:				; CODE XREF: sub_43EC60+82j
fld	[esp+18h+arg_0]
fadd	dword ptr flt_4787CC
mov	eax, dword ptr dword_47D510
add	esi, 4
cmp	esi, eax
fstp	[esp+18h+arg_0]
jle	short loc_43ECB7

loc_43ED0F:				; CODE XREF: sub_43EC60+43j
fld	[esp+18h+var_8]
fadd	dword ptr flt_4787CC
mov	ecx, dword ptr dword_47D514
add	edi, 4
cmp	edi, ecx
fstp	[esp+18h+var_8]
jle	loc_43EC8F
pop	esi
pop	ebp
pop	ebx

loc_43ED31:				; CODE XREF: sub_43EC60+1Dj
pop	edi
add	esp, 8
retn
sub_43EC60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43ED40(float,	int, int, int, float)
sub_43ED40 proc	near			; CODE XREF: sub_43EE50+17Dp

var_24=	dword ptr -24h
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 8
push	ebx
push	ebp
mov	ebp, [esp+10h+arg_10]
push	esi
push	edi
mov	edi, [esp+18h+arg_C]
mov	[esp+18h+var_8], 10h

loc_43ED57:				; CODE XREF: sub_43ED40+FDj
fld	[esp+18h+arg_4]
fadd	dword ptr flt_4786E0
mov	eax, [esp+18h+arg_0]
mov	esi, [esp+18h+arg_8]
mov	ebx, [esp+18h+arg_4]
mov	[esp+18h+var_4], eax
fmul	dword ptr flt_478774
mov	[esp+18h+arg_C], 10h
fstp	[esp+18h+arg_10]

loc_43ED83:				; CODE XREF: sub_43ED40+D7j
fld	[esp+18h+arg_0]
fadd	dword ptr flt_4786E0
mov	ecx, [esp+18h+arg_10]
push	0				; float
push	ecx				; float
push	ecx
fmul	dword ptr flt_478774
fstp	[esp+24h+var_24]		; float
call	sub_43E450
add	esp, 0Ch
test	al, al
jnz	short loc_43EDB3
mov	al, byte_81C1815
test	al, al
jz	short loc_43EDFF

loc_43EDB3:				; CODE XREF: sub_43ED40+68j
cmp	esi, 28h
jl	short loc_43EDFF
cmp	esi, 0C8h
jge	short loc_43EDFF
cmp	edi, 28h
jl	short loc_43EDFF
cmp	edi, 0C8h
jge	short loc_43EDFF
cmp	esi, 48h
jl	short loc_43EDE7
cmp	esi, 0A8h
jge	short loc_43EDE7
cmp	edi, 48h
jl	short loc_43EDE7
cmp	edi, 0A8h
jl	short loc_43EDFF

loc_43EDE7:				; CODE XREF: sub_43ED40+90j
					; sub_43ED40+98j ...
mov	edx, [esp+18h+arg_0]
push	ebp
push	1				; int
push	3F800000h			; int
push	edi				; int
push	esi				; int
push	ebx				; int
push	edx				; float
call	sub_43DA90
add	esp, 1Ch

loc_43EDFF:				; CODE XREF: sub_43ED40+71j
					; sub_43ED40+76j ...
fld	[esp+18h+arg_0]
fadd	dword ptr flt_4786B8
mov	eax, [esp+18h+arg_C]
inc	esi
dec	eax
mov	[esp+18h+arg_C], eax
fstp	[esp+18h+arg_0]
jnz	loc_43ED83
mov	eax, [esp+18h+var_4]
inc	edi
fld	[esp+18h+arg_4]
fadd	dword ptr flt_4786B8
mov	[esp+18h+arg_0], eax
mov	eax, [esp+18h+var_8]
dec	eax
mov	[esp+18h+var_8], eax
fstp	[esp+18h+arg_4]
jnz	loc_43ED57
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 8
retn
sub_43ED40 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43EE50(float)
sub_43EE50 proc	near			; CODE XREF: sub_43F220+BAp

var_28=	dword ptr -28h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 0Ch
mov	edx, dword ptr dword_81BA390
push	ebx
push	ebp
push	esi
mov	esi, dword ptr dword_47D51C
mov	ebp, dword ptr dword_47D518
push	edi
mov	edi, dword ptr dword_81BA37C
shl	edi, 12h
lea	eax, [esi+0Fh]
add	edi, offset byte_7F69A18
mov	[esp+1Ch+var_C], edx
cmp	edx, eax
fild	[esp+1Ch+var_C]
jg	loc_43EF43
mov	eax, edx
lea	ebx, [ebp+0Fh]
shl	eax, 8
mov	[esp+1Ch+var_8], eax

loc_43EE97:				; CODE XREF: sub_43EE50+EDj
mov	ecx, dword ptr dword_81BA38C
mov	[esp+1Ch+var_4], ecx
cmp	ecx, ebx
fild	[esp+1Ch+var_4]
jg	loc_43F016
and	edx, 0FFh
lea	esi, [ecx+1]
shl	edx, 8
add	eax, ecx
lea	eax, [eax+eax*2]
lea	eax, dword_7FE9D44[eax*4]

loc_43EEC5:				; CODE XREF: sub_43EE50+C2j
mov	ebp, ecx
mov	ebx, esi
and	ebp, 0FFh
and	ebx, 0FFh
add	ebp, edx
add	ebx, edx
add	eax, 0Ch
mov	ebp, [edi+ebp*4]
sub	ebp, [edi+ebx*4]
inc	ecx
inc	esi
mov	[esp+1Ch+var_4], ebp
mov	ebp, dword ptr dword_47D518
fild	[esp+1Ch+var_4]
lea	ebx, [ebp+0Fh]
cmp	ecx, ebx
fmul	dword ptr flt_478754
fadd	dword ptr flt_4786E0
fst	dword ptr [eax-10h]
fst	dword ptr [eax-0Ch]
fstp	dword ptr [eax-8]
fadd	dword ptr flt_4786B8
jle	short loc_43EEC5
mov	edx, [esp+1Ch+var_C]
mov	eax, [esp+1Ch+var_8]
mov	esi, dword ptr dword_47D51C
fstp	st

loc_43EF24:				; CODE XREF: sub_43EE50+1C8j
fadd	dword ptr flt_4786B8
inc	edx
lea	ecx, [esi+0Fh]
add	eax, 100h
cmp	edx, ecx
mov	[esp+1Ch+var_C], edx
mov	[esp+1Ch+var_8], eax
jle	loc_43EE97

loc_43EF43:				; CODE XREF: sub_43EE50+35j
mov	edi, dword ptr dword_81BA390
fstp	st
mov	[esp+1Ch+var_C], edi
cmp	edi, esi
fild	[esp+1Ch+var_C]
fstp	[esp+1Ch+var_8]
jg	loc_43F00E

loc_43EF5F:				; CODE XREF: sub_43EE50+1B8j
mov	esi, dword ptr dword_81BA38C
mov	[esp+1Ch+var_4], esi
cmp	esi, ebp
fild	[esp+1Ch+var_4]
fstp	[esp+1Ch+var_C]
jg	short loc_43EFF0
fld	[esp+1Ch+var_8]
fadd	dword ptr flt_4787B8
mov	ebx, [esp+1Ch+var_8]
fmul	dword ptr flt_478774
fstp	[esp+1Ch+var_4]

loc_43EF8D:				; CODE XREF: sub_43EE50+19Ej
fld	[esp+1Ch+var_C]
fadd	dword ptr flt_4787B8
mov	ecx, [esp+1Ch+var_4]
push	0C2200000h			; float
push	ecx				; float
push	ecx
fmul	dword ptr flt_478774
fstp	[esp+28h+var_28]		; float
call	sub_43E450
add	esp, 0Ch
test	al, al
jnz	short loc_43EFC0
mov	al, byte_81C1815
test	al, al
jz	short loc_43EFD5

loc_43EFC0:				; CODE XREF: sub_43EE50+165j
mov	edx, [esp+1Ch+arg_0]
mov	eax, [esp+1Ch+var_C]
push	edx				; float
push	edi				; int
push	esi				; int
push	ebx				; int
push	eax				; float
call	sub_43ED40
add	esp, 14h

loc_43EFD5:				; CODE XREF: sub_43EE50+16Ej
fld	[esp+1Ch+var_C]
fadd	dword ptr flt_4788D4
mov	ebp, dword ptr dword_47D518
add	esi, 10h
cmp	esi, ebp
fstp	[esp+1Ch+var_C]
jle	short loc_43EF8D

loc_43EFF0:				; CODE XREF: sub_43EE50+123j
fld	[esp+1Ch+var_8]
fadd	dword ptr flt_4788D4
mov	eax, dword ptr dword_47D51C
add	edi, 10h
cmp	edi, eax
fstp	[esp+1Ch+var_8]
jle	loc_43EF5F

loc_43F00E:				; CODE XREF: sub_43EE50+109j
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_43F016:				; CODE XREF: sub_43EE50+57j
fstp	st
jmp	loc_43EF24
sub_43EE50 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F020 proc	near			; CODE XREF: sub_43F220+31p

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h
arg_10=	dword ptr  14h

sub	esp, 10h
fild	[esp+10h+arg_8]
mov	eax, [esp+10h+arg_10]
push	ebx
push	ebp
push	esi
fdivr	dword ptr flt_4789E8
mov	esi, [esp+1Ch+arg_8]
push	edi
mov	edi, [esp+20h+arg_0]
shl	eax, 12h
add	eax, offset byte_7F69A18
test	edi, edi
mov	[esp+20h+var_10], eax
fld	st
fmul	st, st(1)
fstp	[esp+20h+var_8]
fstp	st
jge	short loc_43F06D
call	_rand
lea	ecx, [esi+esi]
mov	edi, 0FFh
cdq
sub	edi, ecx
idiv	edi
lea	edi, [edx+esi+1]

loc_43F06D:				; CODE XREF: sub_43F020+35j
mov	ebx, [esp+20h+arg_4]
test	ebx, ebx
jge	short loc_43F08B
call	_rand
lea	edx, [esi+esi]
mov	ecx, 0FFh
sub	ecx, edx
cdq
idiv	ecx
lea	ebx, [edx+esi+1]

loc_43F08B:				; CODE XREF: sub_43F020+53j
mov	ecx, esi
mov	eax, esi
imul	ecx, esi
mov	edx, edi
mov	[esp+20h+var_4], ecx
neg	eax
sub	edx, esi
mov	ebp, eax
cmp	edx, 1
mov	[esp+20h+arg_10], ebp
mov	[esp+20h+arg_8], esi
mov	[esp+20h+arg_0], esi
jge	short loc_43F0BD
mov	edx, esi
sub	edx, edi
lea	edx, [edx+ebp+1]
mov	[esp+20h+arg_10], edx
mov	ebp, edx

loc_43F0BD:				; CODE XREF: sub_43F020+8Dj
mov	edx, ebx
sub	edx, esi
cmp	edx, 1
jge	short loc_43F0CE
mov	edx, esi
sub	edx, ebx
lea	eax, [eax+edx+1]

loc_43F0CE:				; CODE XREF: sub_43F020+A4j
lea	edx, [edi+esi]
cmp	edx, 0FFh
jle	short loc_43F0E4
mov	edx, 0FFh
sub	edx, edi
mov	[esp+20h+arg_8], edx

loc_43F0E4:				; CODE XREF: sub_43F020+B7j
lea	edx, [ebx+esi]
cmp	edx, 0FFh
jle	short loc_43F0FA
mov	esi, 0FFh
sub	esi, ebx
mov	[esp+20h+arg_0], esi

loc_43F0FA:				; CODE XREF: sub_43F020+CDj
mov	esi, [esp+20h+arg_0]
mov	edx, eax
cmp	eax, esi
mov	[esp+20h+arg_4], edx
jge	short loc_43F183
add	ebx, eax
shl	ebx, 8
add	ebx, edi

loc_43F10F:				; CODE XREF: sub_43F020+161j
mov	eax, [esp+20h+arg_8]
mov	esi, ebp
cmp	ebp, eax
jge	short loc_43F170
mov	ebp, edx
imul	ebp, edx

loc_43F11E:				; CODE XREF: sub_43F020+14Aj
mov	eax, esi
imul	eax, esi
add	eax, ebp
cmp	eax, ecx
mov	[esp+20h+var_C], eax
jge	short loc_43F163
fild	[esp+20h+var_C]
mov	ecx, [esp+20h+var_10]
lea	eax, [ebx+esi]
fmul	[esp+20h+var_8]
lea	edi, [ecx+eax*4]
fsqrt
fcos
fadd	ds:dbl_4789E0
fimul	[esp+20h+arg_C]
call	__ftol
mov	ecx, [edi]
mov	edx, [esp+20h+arg_4]
sar	eax, 13h
add	ecx, eax
mov	[edi], ecx
mov	ecx, [esp+20h+var_4]

loc_43F163:				; CODE XREF: sub_43F020+10Bj
mov	eax, [esp+20h+arg_8]
inc	esi
cmp	esi, eax
jl	short loc_43F11E
mov	ebp, [esp+20h+arg_10]

loc_43F170:				; CODE XREF: sub_43F020+F7j
mov	eax, [esp+20h+arg_0]
inc	edx
add	ebx, 100h
cmp	edx, eax
mov	[esp+20h+arg_4], edx
jl	short loc_43F10F

loc_43F183:				; CODE XREF: sub_43F020+E6j
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 10h
retn
sub_43F020 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F190 proc	near			; CODE XREF: sub_43F220+16Ap

arg_0= dword ptr  4

mov	eax, [esp+arg_0]
push	ebx
mov	ebx, eax
xor	eax, 1
shl	ebx, 12h
shl	eax, 12h
add	ebx, offset byte_7F69A18
push	ebp
add	eax, offset byte_7F69A18
push	esi
push	edi
mov	esi, 101h
mov	[esp+10h+arg_0], eax

loc_43F1B7:				; CODE XREF: sub_43F190+81j
lea	eax, [esi+0FEh]
cmp	esi, eax
jge	short loc_43F208
mov	ecx, [esp+10h+arg_0]
sub	eax, esi
mov	edi, eax
lea	edx, [ebx+esi*4]
lea	ecx, [ecx+esi*4+400h]
add	esi, edi

loc_43F1D5:				; CODE XREF: sub_43F190+76j
mov	eax, [ecx-800h]
mov	ebp, [ecx-404h]
add	eax, ebp
mov	ebp, [ecx-3FCh]
add	eax, ebp
mov	ebp, [ecx]
add	eax, ebp
mov	ebp, [edx]
sar	eax, 1
sub	eax, ebp
add	ecx, 4
mov	ebp, eax
add	edx, 4
sar	ebp, 4
sub	eax, ebp
dec	edi
mov	[edx-4], eax
jnz	short loc_43F1D5

loc_43F208:				; CODE XREF: sub_43F190+2Fj
add	esi, 2
cmp	esi, 0FF00h
jl	short loc_43F1B7
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_43F190 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43F220(float)
sub_43F220 proc	near			; CODE XREF: sub_42BB40+99p
					; sub_42C5F0+7FDp ...

var_4= dword ptr -4
arg_0= dword ptr  4

push	ecx
mov	eax, dword ptr dword_81BA37C
push	ebx
push	esi
mov	esi, dword ptr dword_79DBE88
push	eax
push	0FFFFFFBAh
fld	dword ptr [esi+10h]
fmul	dword ptr flt_47888C
push	3
call	__ftol
fld	dword ptr [esi+0Ch]
fmul	dword ptr flt_47888C
push	eax
call	__ftol
push	eax
call	sub_43F020
mov	eax, dword ptr dword_81C1528
mov	esi, 8
fld	dword ptr flt_5727448
add	esp, 14h
cmp	eax, esi
jnz	short loc_43F28A
call	__ftol
cdq
mov	ecx, 9C40h
idiv	ecx
mov	[esp+0Ch+var_4], edx
fild	[esp+0Ch+var_4]
fmul	dword ptr flt_4789F0
jmp	short loc_43F2A5
; ---------------------------------------------------------------------------

loc_43F28A:				; CODE XREF: sub_43F220+4Bj
call	__ftol
cdq
mov	ecx, 4E20h
idiv	ecx
mov	[esp+0Ch+var_4], edx
fild	[esp+0Ch+var_4]
fmul	dword ptr flt_4789EC

loc_43F2A5:				; CODE XREF: sub_43F220+68j
mov	ebx, [esp+0Ch+arg_0]
fstp	dword ptr flt_7D0994C
test	bl, bl
jnz	short loc_43F2BA
call	sub_44E1C0
jmp	short loc_43F2C6
; ---------------------------------------------------------------------------

loc_43F2BA:				; CODE XREF: sub_43F220+91j
mov	byte_7CC9934, 0
call	sub_44F650

loc_43F2C6:				; CODE XREF: sub_43F220+98j
mov	eax, dword ptr dword_81C1528
mov	dword ptr dword_81AA338, 0
cmp	eax, esi
jnz	short loc_43F2E2
push	ebx				; float
call	sub_43EE50
add	esp, 4

loc_43F2E2:				; CODE XREF: sub_43F220+B7j
push	ebx
call	sub_43EC60
add	esp, 4
test	bl, bl
jz	short loc_43F333
mov	al, byte_7CC9934
test	al, al
jz	loc_43F37C
fld dword ptr flt_7EC99C4
push	ebx
push	1
push	3F800000h
call	__ftol
fld dword ptr flt_7EC99C0
push	eax
call	__ftol
mov	edx, dword ptr flt_7EC99C4
push	eax
mov	eax, dword ptr flt_7EC99C0
push	edx
push	eax
call	sub_43D7D0
add	esp, 1Ch
jmp	short loc_43F37C
; ---------------------------------------------------------------------------

loc_43F333:				; CODE XREF: sub_43F220+CDj
push	1
call	sub_44E240
mov	al, byte_47D50C
add	esp, 4
test	al, al
jz	short loc_43F363
cmp	dword ptr dword_81C1528, 7
jz	short loc_43F363
push	0
mov	dword ptr dword_81AA338, 2
call	sub_43EC60
add	esp, 4

loc_43F363:				; CODE XREF: sub_43F220+124j
					; sub_43F220+12Dj
call	sub_43C270
call	sub_44E0E0
call	sub_44E140
call	sub_41BD30
call	sub_44E0C0

loc_43F37C:				; CODE XREF: sub_43F220+D6j
					; sub_43F220+111j
mov	eax, dword ptr dword_81BA37C
xor	eax, 1
push	eax
mov	dword ptr dword_81BA37C, eax
call	sub_43F190
add	esp, 4
pop	esi
pop	ebx
pop	ecx
retn
sub_43F220 endp

; ---------------------------------------------------------------------------
align 10h
; START	OF FUNCTION CHUNK FOR sub_43C520

loc_43F3A0:				; CODE XREF: sub_43C520+14j
mov	word ptr word_81A9D42, 44Ch
mov	dword ptr dword_81A9D48, 41000000h
mov	dword ptr dword_81A9E38, 3F800000h
retn
; END OF FUNCTION CHUNK	FOR sub_43C520
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F3C0 proc	near			; CODE XREF: sub_40D890+B1p
					; sub_41D2F0+162p

arg_0= dword ptr  4

fld	dword ptr flt_4786F4
mov	eax, [esp+arg_0]
mov	ecx, 3

loc_43F3CF:				; CODE XREF: sub_43F3C0+1Dj
fld	dword ptr [eax]
fld	st
fmul	st, st(1)
add	eax, 4
dec	ecx
faddp	st(2), st
fstp	st
jnz	short loc_43F3CF
fsqrt
retn
sub_43F3C0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F3F0 proc	near			; CODE XREF: sub_40F630+1E6p

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	ecx, [esp+arg_4]
push	esi
mov	esi, [esp+4+arg_0]
xor	edx, edx
sub	esi, ecx

loc_43F3FD:				; CODE XREF: sub_43F3F0+28j
fld	dword ptr [esi+ecx]
fsub	dword ptr [ecx]
fabs
fcomp	ds:dbl_478740
fnstsw	ax
test	ah, 41h
jz	short loc_43F421
inc	edx
add	ecx, 4
cmp	edx, 3
jl	short loc_43F3FD
mov	eax, 1
pop	esi
retn
; ---------------------------------------------------------------------------

loc_43F421:				; CODE XREF: sub_43F3F0+1Fj
xor	eax, eax
pop	esi
retn
sub_43F3F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F430 proc	near			; CODE XREF: sub_445960+1DEp

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	eax, [esp+arg_0]
mov	ecx, [esp+arg_4]
mov	edx, [esp+arg_8]
fld	dword ptr [eax]
fmul	dword ptr [ecx]
fstp	dword ptr [edx]
fld	dword ptr [eax+4]
fmul	dword ptr [ecx+4]
fstp	dword ptr [edx+4]
fld	dword ptr [eax+8]
fmul	dword ptr [ecx+8]
fstp	dword ptr [edx+8]
retn
sub_43F430 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43F460(int, float, int, int)
sub_43F460 proc	near			; CODE XREF: sub_41D2F0+99p
					; sub_41D2F0+272p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	eax, [esp+arg_8]
mov	ecx, [esp+arg_0]
fld	[esp+arg_4]
fmul	dword ptr [eax]
mov	edx, [esp+arg_C]
fadd	dword ptr [ecx]
fstp	dword ptr [edx]
fld	[esp+arg_4]
fmul	dword ptr [eax+4]
fadd	dword ptr [ecx+4]
fstp	dword ptr [edx+4]
fld	[esp+arg_4]
fmul	dword ptr [eax+8]
fadd	dword ptr [ecx+8]
fstp	dword ptr [edx+8]
retn
sub_43F460 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F4A0 proc	near			; CODE XREF: sub_44FB80+3Bp
					; sub_44FB80+4Fp ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	ecx, [esp+arg_4]
mov	eax, [esp+arg_0]
mov	edx, [esp+arg_8]
fld	dword ptr [ecx+8]
fmul	dword ptr [eax+4]
fld	dword ptr [eax+8]
fmul	dword ptr [ecx+4]
fsubp	st(1), st
fstp	dword ptr [edx]
fld	dword ptr [eax+8]
fmul	dword ptr [ecx]
fld	dword ptr [eax]
fmul	dword ptr [ecx+8]
fsubp	st(1), st
fstp	dword ptr [edx+4]
fld	dword ptr [eax]
fmul	dword ptr [ecx+4]
fld	dword ptr [ecx]
fmul	dword ptr [eax+4]
fsubp	st(1), st
fstp	dword ptr [edx+8]
retn
sub_43F4A0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F4E0 proc	near			; CODE XREF: sub_402560+1EFp

arg_0= dword ptr  4

mov	edx, [esp+arg_0]
mov	ecx, 3
fld	dword ptr flt_4786F4
mov	eax, edx

loc_43F4F1:				; CODE XREF: sub_43F4E0+1Fj
fld	dword ptr [eax]
fld	st
fmul	st, st(1)
add	eax, 4
dec	ecx
faddp	st(2), st
fstp	st
jnz	short loc_43F4F1
fsqrt
fcom	dword ptr flt_4786F4
fnstsw	ax
test	ah, 40h
jz	short loc_43F519
fstp	st
fld	dword ptr flt_4786F4
retn
; ---------------------------------------------------------------------------

loc_43F519:				; CODE XREF: sub_43F4E0+2Ej
mov	eax, edx
mov	ecx, 3

loc_43F520:				; CODE XREF: sub_43F4E0+4Bj
fld	dword ptr [eax]
fdiv	st, st(1)
add	eax, 4
dec	ecx
fstp	dword ptr [eax-4]
jnz	short loc_43F520
retn
sub_43F4E0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F530 proc	near			; CODE XREF: sub_401650+44p
					; sub_402560+5Bp ...

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 10h
mov	eax, [esp+10h+arg_0]
xor	ecx, ecx
fld	dword ptr [eax+8]
fmul	dword ptr flt_478A00
fld	st
fsin
fstp	[esp+10h+arg_0]
fcos
fld	dword ptr [eax+4]
fmul	dword ptr flt_478A00
fld	st
fsin
fstp	[esp+10h+var_4]
fcos
fstp	[esp+10h+var_8]
fld	dword ptr [eax]
fmul	dword ptr flt_478A00
mov	eax, [esp+10h+arg_4]
fld	st
fsin
mov	[eax+0Ch], ecx
mov	[eax+1Ch], ecx
mov	[eax+2Ch], ecx
fstp	[esp+10h+var_10]
fcos
fstp	[esp+10h+var_C]
fld	[esp+10h+var_8]
fmul	st, st(1)
fstp	dword ptr [eax]
fld	[esp+10h+var_8]
fmul	[esp+10h+arg_0]
fstp	dword ptr [eax+10h]
fld	[esp+10h+var_4]
fchs
fstp	dword ptr [eax+20h]
fld	[esp+10h+var_10]
fmul	[esp+10h+var_4]
fld	st
fmul	st, st(2)
fld	[esp+10h+var_C]
fmul	[esp+10h+arg_0]
fsubp	st(1), st
fstp	dword ptr [eax+4]
fmul	[esp+10h+arg_0]
fld	[esp+10h+var_C]
fmul	st, st(2)
faddp	st(1), st
fstp	dword ptr [eax+14h]
fld	[esp+10h+var_10]
fmul	[esp+10h+var_8]
fstp	dword ptr [eax+24h]
fld	[esp+10h+var_C]
fmul	[esp+10h+var_4]
fld	st
fmul	st, st(2)
fld	[esp+10h+var_10]
fmul	[esp+10h+arg_0]
faddp	st(1), st
fstp	dword ptr [eax+8]
fmul	[esp+10h+arg_0]
fld	[esp+10h+var_10]
fmul	st, st(2)
fsubp	st(1), st
fstp	dword ptr [eax+18h]
fstp	st
fld	[esp+10h+var_C]
fmul	[esp+10h+var_8]
fstp	dword ptr [eax+28h]
add	esp, 10h
retn
sub_43F530 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F610 proc	near			; CODE XREF: sub_402560+66p
					; sub_402560+C6p ...

var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 10h
mov	eax, [esp+10h+arg_0]
xor	ecx, ecx
fld	dword ptr [eax+8]
fmul	dword ptr flt_478A00
fld	st
fsin
fstp	[esp+10h+arg_0]
fcos
fld	dword ptr [eax+4]
fmul	dword ptr flt_478A00
fld	st
fsin
fstp	[esp+10h+var_4]
fcos
fstp	[esp+10h+var_8]
fld	dword ptr [eax]
fmul	dword ptr flt_478A00
mov	eax, [esp+10h+arg_4]
fld	st
fsin
mov	[eax+0Ch], ecx
mov	[eax+1Ch], ecx
mov	[eax+2Ch], ecx
fstp	[esp+10h+var_10]
fcos
fstp	[esp+10h+var_C]
fld	[esp+10h+var_8]
fmul	st, st(1)
fstp	dword ptr [eax]
fld	[esp+10h+var_8]
fmul	[esp+10h+arg_0]
fstp	dword ptr [eax+4]
fld	[esp+10h+var_4]
fchs
fstp	dword ptr [eax+8]
fld	[esp+10h+var_10]
fmul	[esp+10h+var_4]
fld	st
fmul	st, st(2)
fld	[esp+10h+var_C]
fmul	[esp+10h+arg_0]
fsubp	st(1), st
fstp	dword ptr [eax+10h]
fmul	[esp+10h+arg_0]
fld	[esp+10h+var_C]
fmul	st, st(2)
faddp	st(1), st
fstp	dword ptr [eax+14h]
fld	[esp+10h+var_10]
fmul	[esp+10h+var_8]
fstp	dword ptr [eax+18h]
fld	[esp+10h+var_C]
fmul	[esp+10h+var_4]
fld	st
fmul	st, st(2)
fld	[esp+10h+var_10]
fmul	[esp+10h+arg_0]
faddp	st(1), st
fstp	dword ptr [eax+20h]
fmul	[esp+10h+arg_0]
fld	[esp+10h+var_10]
fmul	st, st(2)
fsubp	st(1), st
fstp	dword ptr [eax+24h]
fstp	st
fld	[esp+10h+var_C]
fmul	[esp+10h+var_8]
fstp	dword ptr [eax+28h]
add	esp, 10h
retn
sub_43F610 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F6F0 proc	near			; CODE XREF: sub_402560+B7p
					; sub_402560+E2p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	eax, [esp+arg_0]
mov	ecx, [esp+arg_4]
mov	edx, [esp+arg_8]
fld	dword ptr [eax]
fmul	dword ptr [ecx]
fld	dword ptr [eax+4]
fmul	dword ptr [ecx+10h]
faddp	st(1), st
fld	dword ptr [eax+8]
fmul	dword ptr [ecx+20h]
faddp	st(1), st
fstp	dword ptr [edx]
fld	dword ptr [eax+4]
fmul	dword ptr [ecx+14h]
fld	dword ptr [ecx+4]
fmul	dword ptr [eax]
faddp	st(1), st
fld	dword ptr [ecx+24h]
fmul	dword ptr [eax+8]
faddp	st(1), st
fstp	dword ptr [edx+4]
fld	dword ptr [eax+4]
fmul	dword ptr [ecx+18h]
fld	dword ptr [ecx+8]
fmul	dword ptr [eax]
faddp	st(1), st
fld	dword ptr [ecx+28h]
fmul	dword ptr [eax+8]
faddp	st(1), st
fstp	dword ptr [edx+8]
fld	dword ptr [eax+4]
fmul	dword ptr [ecx+1Ch]
fld	dword ptr [ecx+0Ch]
fmul	dword ptr [eax]
faddp	st(1), st
fld	dword ptr [ecx+2Ch]
fmul	dword ptr [eax+8]
faddp	st(1), st
fadd	dword ptr [eax+0Ch]
fstp	dword ptr [edx+0Ch]
fld	dword ptr [eax+18h]
fmul	dword ptr [ecx+20h]
fld	dword ptr [eax+14h]
fmul	dword ptr [ecx+10h]
faddp	st(1), st
fld	dword ptr [eax+10h]
fmul	dword ptr [ecx]
faddp	st(1), st
fstp	dword ptr [edx+10h]
fld	dword ptr [eax+18h]
fmul	dword ptr [ecx+24h]
fld	dword ptr [eax+14h]
fmul	dword ptr [ecx+14h]
faddp	st(1), st
fld	dword ptr [eax+10h]
fmul	dword ptr [ecx+4]
faddp	st(1), st
fstp	dword ptr [edx+14h]
fld	dword ptr [eax+18h]
fmul	dword ptr [ecx+28h]
fld	dword ptr [eax+14h]
fmul	dword ptr [ecx+18h]
faddp	st(1), st
fld	dword ptr [eax+10h]
fmul	dword ptr [ecx+8]
faddp	st(1), st
fstp	dword ptr [edx+18h]
fld	dword ptr [ecx+2Ch]
fmul	dword ptr [eax+18h]
fld	dword ptr [eax+14h]
fmul	dword ptr [ecx+1Ch]
faddp	st(1), st
fld	dword ptr [eax+10h]
fmul	dword ptr [ecx+0Ch]
faddp	st(1), st
fadd	dword ptr [eax+1Ch]
fstp	dword ptr [edx+1Ch]
fld	dword ptr [eax+28h]
fmul	dword ptr [ecx+20h]
fld	dword ptr [eax+24h]
fmul	dword ptr [ecx+10h]
faddp	st(1), st
fld	dword ptr [ecx]
fmul	dword ptr [eax+20h]
faddp	st(1), st
fstp	dword ptr [edx+20h]
fld	dword ptr [eax+28h]
fmul	dword ptr [ecx+24h]
fld	dword ptr [eax+24h]
fmul	dword ptr [ecx+14h]
faddp	st(1), st
fld	dword ptr [ecx+4]
fmul	dword ptr [eax+20h]
faddp	st(1), st
fstp	dword ptr [edx+24h]
fld	dword ptr [eax+28h]
fmul	dword ptr [ecx+28h]
fld	dword ptr [eax+24h]
fmul	dword ptr [ecx+18h]
faddp	st(1), st
fld	dword ptr [ecx+8]
fmul	dword ptr [eax+20h]
faddp	st(1), st
fstp	dword ptr [edx+28h]
fld	dword ptr [eax+28h]
fmul	dword ptr [ecx+2Ch]
fld	dword ptr [eax+24h]
fmul	dword ptr [ecx+1Ch]
faddp	st(1), st
fld	dword ptr [ecx+0Ch]
fmul	dword ptr [eax+20h]
faddp	st(1), st
fadd	dword ptr [eax+2Ch]
fstp	dword ptr [edx+2Ch]
retn
sub_43F6F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F830 proc	near			; CODE XREF: sub_401650+CAp
					; sub_40D960+21p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	ecx, [esp+arg_4]
mov	eax, [esp+arg_0]
mov	edx, [esp+arg_8]
fld	dword ptr [ecx+4]
fmul	dword ptr [eax+4]
fld	dword ptr [ecx+8]
fmul	dword ptr [eax+8]
faddp	st(1), st
fld	dword ptr [eax]
fmul	dword ptr [ecx]
faddp	st(1), st
fstp	dword ptr [edx]
fld	dword ptr [ecx+10h]
fmul	dword ptr [eax]
fld	dword ptr [ecx+14h]
fmul	dword ptr [eax+4]
faddp	st(1), st
fld	dword ptr [ecx+18h]
fmul	dword ptr [eax+8]
faddp	st(1), st
fstp	dword ptr [edx+4]
fld	dword ptr [ecx+20h]
fmul	dword ptr [eax]
fld	dword ptr [ecx+24h]
fmul	dword ptr [eax+4]
faddp	st(1), st
fld	dword ptr [ecx+28h]
fmul	dword ptr [eax+8]
faddp	st(1), st
fstp	dword ptr [edx+8]
retn
sub_43F830 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F890 proc	near			; CODE XREF: sub_40FA40+6Dp
					; sub_43E4B0+F1p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	ecx, [esp+arg_4]
mov	eax, [esp+arg_0]
mov	edx, [esp+arg_8]
fld	dword ptr [ecx+20h]
fmul	dword ptr [eax+8]
fld	dword ptr [ecx+10h]
fmul	dword ptr [eax+4]
faddp	st(1), st
fld	dword ptr [eax]
fmul	dword ptr [ecx]
faddp	st(1), st
fstp	dword ptr [edx]
fld	dword ptr [ecx+4]
fmul	dword ptr [eax]
fld	dword ptr [ecx+24h]
fmul	dword ptr [eax+8]
faddp	st(1), st
fld	dword ptr [ecx+14h]
fmul	dword ptr [eax+4]
faddp	st(1), st
fstp	dword ptr [edx+4]
fld	dword ptr [ecx+8]
fmul	dword ptr [eax]
fld	dword ptr [ecx+28h]
fmul	dword ptr [eax+8]
faddp	st(1), st
fld	dword ptr [ecx+18h]
fmul	dword ptr [eax+4]
faddp	st(1), st
fstp	dword ptr [edx+8]
retn
sub_43F890 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F8F0 proc	near			; CODE XREF: sub_402560+104p
					; sub_402560+1B4p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

mov	eax, [esp+arg_4]
mov	ecx, [esp+arg_0]
mov	edx, [esp+arg_8]
fld	dword ptr [eax+4]
fmul	dword ptr [ecx+4]
fld	dword ptr [eax+8]
fmul	dword ptr [ecx+8]
faddp	st(1), st
fld	dword ptr [ecx]
fmul	dword ptr [eax]
faddp	st(1), st
fadd	dword ptr [eax+0Ch]
fstp	dword ptr [edx]
fld	dword ptr [eax+10h]
fmul	dword ptr [ecx]
fld	dword ptr [eax+14h]
fmul	dword ptr [ecx+4]
faddp	st(1), st
fld	dword ptr [eax+18h]
fmul	dword ptr [ecx+8]
faddp	st(1), st
fadd	dword ptr [eax+1Ch]
fstp	dword ptr [edx+4]
fld	dword ptr [eax+20h]
fmul	dword ptr [ecx]
fld	dword ptr [eax+24h]
fmul	dword ptr [ecx+4]
faddp	st(1), st
fld	dword ptr [eax+28h]
fmul	dword ptr [ecx+8]
faddp	st(1), st
fadd	dword ptr [eax+2Ch]
fstp	dword ptr [edx+8]
retn
sub_43F8F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F950 proc	near			; CODE XREF: sub_40F630+1FFp
					; sub_40F630+20Ep ...

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 8
mov	eax, [esp+8+arg_0]
fld	dword ptr [eax+8]
fmul	ds:dbl_4789F8
fld	st
fsin
fstp	[esp+8+arg_0]
fcos
fld	dword ptr [eax+4]
fmul	ds:dbl_4789F8
fld	st
fsin
fstp	[esp+8+var_4]
fcos
fld	dword ptr [eax]
fmul	ds:dbl_4789F8
mov	eax, [esp+8+arg_4]
fld	st
fsin
fstp	[esp+8+var_8]
fcos
fld	[esp+8+var_8]
fmul	st, st(2)
fld	st(1)
fmul	[esp+8+var_4]
fld	st(1)
fmul	st, st(5)
fld	st(1)
fmul	[esp+8+arg_0]
fsubp	st(1), st
fstp	dword ptr [eax]
fmul	st, st(4)
fxch	st(1)
fmul	[esp+8+arg_0]
faddp	st(1), st
fstp	dword ptr [eax+4]
fmulp	st(1), st
fld	[esp+8+var_8]
fmul	[esp+8+var_4]
fld	st(1)
fmul	[esp+8+arg_0]
fld	st(1)
fmul	st, st(4)
fsubp	st(1), st
fstp	dword ptr [eax+8]
fmul	[esp+8+arg_0]
fxch	st(1)
fmul	st, st(2)
faddp	st(1), st
fstp	dword ptr [eax+0Ch]
fstp	st
add	esp, 8
retn
sub_43F950 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43F9F0 proc	near			; CODE XREF: sub_40F630+26Dp

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	eax, [esp+arg_0]
mov	ecx, [esp+arg_4]
fld	dword ptr [eax+4]
fld	dword ptr [eax+8]
fld	st(1)
fmul	st, st(2)
fadd	st, st
fsubr	ds:dbl_478A08
fld	st(1)
fmul	st, st(2)
fadd	st, st
fsubp	st(1), st
fstp	dword ptr [ecx]
fstp	st
fstp	st
fld	dword ptr [eax+8]
fmul	dword ptr [eax+0Ch]
fld	dword ptr [eax]
fmul	dword ptr [eax+4]
faddp	st(1), st
fadd	st, st
fstp	dword ptr [ecx+10h]
fld	dword ptr [eax+8]
fmul	dword ptr [eax]
fadd	st, st
fld	dword ptr [eax+0Ch]
fmul	dword ptr [eax+4]
fadd	st, st
fsubp	st(1), st
fstp	dword ptr [ecx+20h]
fld	dword ptr [eax]
fmul	dword ptr [eax+4]
fadd	st, st
fld	dword ptr [eax+8]
fmul	dword ptr [eax+0Ch]
fadd	st, st
fsubp	st(1), st
fstp	dword ptr [ecx+4]
fld	dword ptr [eax]
fld	dword ptr [eax+8]
fld	st(1)
fmul	st, st(2)
fadd	st, st
fsubr	ds:dbl_478A08
fld	st(1)
fmul	st, st(2)
fadd	st, st
fsubp	st(1), st
fstp	dword ptr [ecx+14h]
fstp	st
fstp	st
fld	dword ptr [eax+8]
fmul	dword ptr [eax+4]
fld	dword ptr [eax]
fmul	dword ptr [eax+0Ch]
faddp	st(1), st
fadd	st, st
fstp	dword ptr [ecx+24h]
fld	dword ptr [eax+8]
fmul	dword ptr [eax]
fld	dword ptr [eax+0Ch]
fmul	dword ptr [eax+4]
faddp	st(1), st
fadd	st, st
fstp	dword ptr [ecx+8]
fld	dword ptr [eax+8]
fmul	dword ptr [eax+4]
fadd	st, st
fld	dword ptr [eax]
fmul	dword ptr [eax+0Ch]
fadd	st, st
fsubp	st(1), st
fstp	dword ptr [ecx+18h]
fld	dword ptr [eax]
fld	dword ptr [eax+4]
fld	st(1)
fmul	st, st(2)
fadd	st, st
fsubr	ds:dbl_478A08
fld	st(1)
fmul	st, st(2)
fadd	st, st
fsubp	st(1), st
fstp	dword ptr [ecx+28h]
fstp	st
fstp	st
retn
sub_43F9F0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43FAD0(int, int, float, int)
sub_43FAD0 proc	near			; CODE XREF: sub_40F630+23Ap

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	ecx, [esp+arg_0]
push	esi
fld	dword ptr flt_4786F4
fld	dword ptr flt_4786F4
push	edi
mov	edi, [esp+8+arg_4]
mov	esi, ecx
mov	eax, edi
sub	esi, edi
mov	edx, 4

loc_43FAF1:				; CODE XREF: sub_43FAD0+41j
fld	dword ptr [esi+eax]
fsub	dword ptr [eax]
add	eax, 4
dec	edx
fld	st
fmul	st, st(1)
faddp	st(3), st
fstp	st
fld	dword ptr [esi+eax-4]
fadd	dword ptr [eax-4]
fld	st
fmul	st, st(1)
faddp	st(2), st
fstp	st
jnz	short loc_43FAF1
fxch	st(1)
fcomp	st(1)
fnstsw	ax
test	ah, 41h
fstp	st
jnz	short loc_43FB33
mov	eax, edi
mov	edx, 4

loc_43FB27:				; CODE XREF: sub_43FAD0+61j
fld	dword ptr [eax]
fchs
fstp	dword ptr [eax]
add	eax, 4
dec	edx
jnz	short loc_43FB27

loc_43FB33:				; CODE XREF: sub_43FAD0+4Ej
fld	dword ptr [edi+8]
fmul	dword ptr [ecx+8]
fld	dword ptr [edi+4]
fmul	dword ptr [ecx+4]
faddp	st(1), st
fld	dword ptr [edi+0Ch]
fmul	dword ptr [ecx+0Ch]
faddp	st(1), st
fld	dword ptr [ecx]
fmul	dword ptr [edi]
faddp	st(1), st
fst	[esp+8+arg_4]
fadd	ds:dbl_478A08
fcomp	ds:dbl_478A18
fnstsw	ax
test	ah, 41h
jnz	loc_43FBEF
fld	[esp+8+arg_4]
fsubr	ds:dbl_478A08
fcomp	ds:dbl_478A18
fnstsw	ax
test	ah, 41h
jnz	short loc_43FBB8
fld	[esp+8+arg_4]
call	__CIacos
fst	[esp+8+arg_4]
fsin
fstp	[esp+8+arg_0]
fld	[esp+8+arg_8]
fsubr	ds:dbl_478A08
fmul	[esp+8+arg_4]
fsin
fdiv	[esp+8+arg_0]
fld	[esp+8+arg_4]
fmul	[esp+8+arg_8]
fsin
fdiv	[esp+8+arg_0]
jmp	short loc_43FBC6
; ---------------------------------------------------------------------------

loc_43FBB8:				; CODE XREF: sub_43FAD0+AFj
fld	[esp+8+arg_8]
fsubr	ds:dbl_478A08
fld	[esp+8+arg_8]

loc_43FBC6:				; CODE XREF: sub_43FAD0+E6j
mov	ecx, [esp+8+arg_C]
mov	eax, edi
sub	ecx, edi
mov	edx, 4

loc_43FBD3:				; CODE XREF: sub_43FAD0+116j
fld	st(1)
fmul	dword ptr [eax+esi]
fld	st(1)
fmul	dword ptr [eax]
add	eax, 4
dec	edx
faddp	st(1), st
fstp	dword ptr [ecx+eax-4]
jnz	short loc_43FBD3
fstp	st
pop	edi
pop	esi
fstp	st
retn
; ---------------------------------------------------------------------------

loc_43FBEF:				; CODE XREF: sub_43FAD0+94j
fld	dword ptr [ecx+4]
mov	eax, [esp+8+arg_C]
fchs
fstp	dword ptr [eax]
mov	edx, [ecx]
mov	[eax+4], edx
fld	dword ptr [ecx+0Ch]
fchs
fstp	dword ptr [eax+8]
fld	[esp+8+arg_8]
fsubr	ds:dbl_478A08
mov	edx, [ecx+8]
sub	ecx, eax
mov	[eax+0Ch], edx
mov	edx, 3
fmul	ds:dbl_478A10
fsin
fld	[esp+8+arg_8]
fmul	ds:dbl_478A10
fsin

loc_43FC32:				; CODE XREF: sub_43FAD0+174j
fld	st(1)
fmul	dword ptr [ecx+eax]
fld	st(1)
fmul	dword ptr [eax]
add	eax, 4
dec	edx
faddp	st(1), st
fstp	dword ptr [eax-4]
jnz	short loc_43FC32
fstp	st
pop	edi
pop	esi
fstp	st
retn
sub_43FAD0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43FC50 proc	near			; CODE XREF: sub_4100E0+ABp
					; sub_41D870+44p ...

var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

sub	esp, 8
mov	ecx, [esp+8+arg_4]
mov	eax, [esp+8+arg_0]
mov	edx, [esp+8+arg_8]
fld	dword ptr [ecx+4]
fsub	dword ptr [eax+4]
fld	dword ptr [edx+8]
fsub	dword ptr [eax+8]
fld	dword ptr [ecx+8]
fsub	dword ptr [eax+8]
fld	dword ptr [edx+4]
fsub	dword ptr [eax+4]
fstp	[esp+8+var_8]
fld	st(1)
fmul	st, st(3)
fld	[esp+8+var_8]
fmul	st, st(2)
fsubp	st(1), st
fstp	[esp+8+arg_0]
fld	dword ptr [edx]
fsub	dword ptr [eax]
fstp	[esp+8+var_4]
fld	dword ptr [ecx]
fsub	dword ptr [eax]
fstp	[esp+8+arg_8]
fld	[esp+8+var_4]
fmul	st, st(1)
fld	[esp+8+arg_8]
fmul	st, st(3)
fsubp	st(1), st
fstp	[esp+8+arg_4]
fstp	st
fstp	st
fld	[esp+8+arg_8]
fmul	[esp+8+var_8]
fld	[esp+8+var_4]
fmul	st, st(2)
fsubp	st(1), st
fstp	st(1)
fld	st
fmul	st, st(1)
fld	[esp+8+arg_4]
fmul	[esp+8+arg_4]
faddp	st(1), st
fld	[esp+8+arg_0]
fmul	[esp+8+arg_0]
faddp	st(1), st
fsqrt
fcom	ds:dbl_478738
fnstsw	ax
test	ah, 40h
jnz	short loc_43FD0C
fld	[esp+8+arg_0]
mov	eax, [esp+8+arg_C]
fdiv	st, st(1)
fstp	dword ptr [eax]
fld	[esp+8+arg_4]
fdiv	st, st(1)
fstp	dword ptr [eax+4]
fxch	st(1)
fdiv	st, st(1)
fstp	dword ptr [eax+8]
fstp	st
add	esp, 8
retn
; ---------------------------------------------------------------------------

loc_43FD0C:				; CODE XREF: sub_43FC50+98j
fstp	st
fstp	st
add	esp, 8
retn
sub_43FC50 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43FD20 proc	near			; CODE XREF: sub_430580+226p

var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 0Ch
push	ebx
push	ebp
push	esi
push	edi
mov	[esp+1Ch+var_4], 0
call	sub_44F650
mov	eax, offset dword_81BDE6C

loc_43FD39:				; CODE XREF: sub_43FD20+152j
mov	[esp+1Ch+var_C], eax
mov	[esp+1Ch+var_8], 10h

loc_43FD45:				; CODE XREF: sub_43FD20+147j
mov	ebx, [eax]
test	ebx, ebx
jz	loc_43FE53

loc_43FD4F:				; CODE XREF: sub_43FD20+12Dj
cmp	byte ptr [ebx],	0
jz	loc_43FE45
mov	al, [ebx+150h]
test	al, al
jz	loc_43FE45
fld	dword ptr [ebx+158h]
fcomp	dword ptr flt_478754
fnstsw	ax
test	ah, 1
jnz	loc_43FE45
movsx	eax, word ptr [ebx+2]
mov	edx, [ebx+8]
push	0				; char
lea	ecx, [eax+eax*2]
push	0				; char
shl	ecx, 3
sub	ecx, eax
lea	ebp, byte_5729398[ecx*8]
mov	[ebp+68h], edx
mov	al, [ebx+0F5h]
mov	[ebp+0A0h], al
mov	ecx, [ebx+0Ch]
mov	[ebp+6Ch], ecx
mov	edx, [ebx+10h]
mov	[ebp+70h], edx
mov	eax, [ebx+14h]
lea	ecx, [ebx+24h]
mov	[ebp+74h], eax
mov	al, [ebx+0F6h]
lea	edx, [ebx+18h]
push	ecx				; int
mov	ecx, [ebx+0FCh]
push	edx				; int
mov	edx, [ebx+0F8h]
push	eax				; int
push	ecx				; float
push	edx				; int
push	offset dword_688D5A8		; int
mov	ecx, ebp
call	sub_40F630
lea	esi, [ebx+120h]
push	1
lea	eax, [ebx+114h]
push	esi
lea	ecx, [ebx+108h]
push	eax				; float
push	ecx				; int
push	offset dword_688D5A8		; int
mov	ecx, ebp
call	sub_40FA40
sub	esp, 30h
mov	ecx, 0Ch
mov	edi, esp
push	offset byte_81C164C		; int
push	offset flt_81C17BC		; float
rep movsd
call	sub_44FB80
add	esp, 38h
test	al, al
jz	short loc_43FE45
push	0FFFFFFFFh			; int
push	0FFFFFFFFh			; int
push	1				; char
push	offset byte_81C164C		; float
push	offset flt_81C17BC		; float
mov	ecx, ebp
call	sub_4100E0
test	al, al
jz	short loc_43FE45
mov	[esp+1Ch+var_4], ebx

loc_43FE45:				; CODE XREF: sub_43FD20+32j
					; sub_43FD20+40j ...
mov	ebx, [ebx+174h]
test	ebx, ebx
jnz	loc_43FD4F

loc_43FE53:				; CODE XREF: sub_43FD20+29j
mov	eax, [esp+1Ch+var_C]
mov	ecx, [esp+1Ch+var_8]
add	eax, 10h
dec	ecx
mov	[esp+1Ch+var_C], eax
mov	[esp+1Ch+var_8], ecx
jnz	loc_43FD45
cmp	eax, offset byte_81BEE6C
jl	loc_43FD39
mov	eax, [esp+1Ch+var_4]
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
sub_43FD20 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_43FE90 proc	near			; CODE XREF: sub_43FF60+48p
					; sub_43FF60+275p ...

var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8

sub	esp, 0Ch
push	esi
mov	esi, [esp+10h+arg_0]
push	edi
mov	edi, [esp+14h+arg_4]
mov	al, [esi+0CCh]
mov	[edi+44h], al
mov	al, [esi+0CCh]
test	al, al
jz	short loc_43FEF2
mov	edx, [esi+10h]
mov	eax, [esi+0Ch]
lea	ecx, [esp+14h+var_C]
push	ecx				; int
push	edx				; float
push	eax				; float
call	sub_43CCE0
fld	[esp+20h+var_C]
fadd	dword ptr [esi+0D8h]
add	esp, 0Ch
fstp	dword ptr [edi+48h]
fld	[esp+14h+var_8]
fadd	dword ptr [esi+0DCh]
fstp	dword ptr [edi+4Ch]
fld	[esp+14h+var_4]
fadd	dword ptr [esi+0E0h]
fstp	dword ptr [edi+50h]
pop	edi
pop	esi
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_43FEF2:				; CODE XREF: sub_43FE90+1Ej
mov	edx, [esi+10h]
mov	eax, [esi+0Ch]
lea	ecx, [esp+14h+var_C]
push	ecx				; int
push	edx				; float
push	eax				; float
call	sub_43CCE0
fld	[esp+20h+var_C]
fmul	dword ptr flt_478700
fld	[esp+20h+var_8]
fmul	dword ptr flt_478700
add	esp, 0Ch
fstp	[esp+14h+var_8]
fld	[esp+14h+var_4]
fmul	dword ptr flt_478700
fstp	[esp+14h+var_4]
fadd	dword ptr [esi+0D8h]
fstp	dword ptr [edi+48h]
fld	[esp+14h+var_8]
fadd	dword ptr [esi+0DCh]
fstp	dword ptr [edi+4Ch]
fld	[esp+14h+var_4]
fadd	dword ptr [esi+0E0h]
fstp	dword ptr [edi+50h]
pop	edi
pop	esi
add	esp, 0Ch
retn
sub_43FE90 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_43FF60(int, int, float)
sub_43FF60 proc	near			; CODE XREF: sub_416D40+3Ap
					; sub_420DE0+67p ...

var_24=	dword ptr -24h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch

sub	esp, 0Ch
push	ebx
push	ebp
push	esi
mov	esi, [esp+18h+arg_0]
push	edi
fld	dword ptr [esi+158h]
fcomp	dword ptr flt_478754
fnstsw	ax
test	ah, 1
jnz	loc_440689
movsx	eax, word ptr [esi+2]
xor	ebx, ebx
lea	ecx, [eax+eax*2]
shl	ecx, 3
sub	ecx, eax
lea	edi, byte_5729398[ecx*8]
push	edi
push	esi
mov	[edi+84h], ebx
mov	dl, [esi+0D4h]
mov	[edi+45h], dl
call	sub_43FE90
mov	eax, [esi+8]
add	esp, 8
mov	[edi+68h], eax
mov	cl, [esi+0F5h]
mov	[edi+0A0h], cl
mov	edx, [esi+0Ch]
mov	[edi+6Ch], edx
mov	eax, [esi+10h]
mov	[edi+70h], eax
mov	ecx, [esi+14h]
mov	[edi+74h], ecx
mov	al, [esi+100h]
test	al, al
jz	short loc_440012
mov	al, byte ptr [esp+1Ch+arg_4]
test	al, al
jz	short loc_43FFE9
push	ebx
jmp	short loc_43FFEB
; ---------------------------------------------------------------------------

loc_43FFE9:				; CODE XREF: sub_43FF60+84j
push	1

loc_43FFEB:				; CODE XREF: sub_43FF60+87j
mov	cl, [esi+0F6h]
lea	edx, [esi+24h]
push	ebx
lea	eax, [esi+18h]
push	edx
mov	edx, [esi+0FCh]
push	eax
mov	eax, [esi+0F8h]
push	ecx
mov	ecx, [esi+104h]
push	edx
push	eax
push	ecx
jmp	short loc_440037
; ---------------------------------------------------------------------------

loc_440012:				; CODE XREF: sub_43FF60+7Cj
mov	cl, [esi+0F6h]
push	1				; char
lea	edx, [esi+24h]
push	ebx				; char
lea	eax, [esi+18h]
push	edx				; int
mov	edx, [esi+0FCh]
push	eax				; int
mov	eax, [esi+0F8h]
push	ecx				; int
push	edx				; float
push	eax				; float
push	offset dword_688D5A8		; int

loc_440037:				; CODE XREF: sub_43FF60+B0j
mov	ecx, edi
call	sub_40F630
mov	al, byte ptr [esp+1Ch+arg_8]
test	al, al
jz	loc_4401E9
mov	byte ptr [edi+44h], 0
mov	al, [esi+78h]
cmp	al, 4
jnz	short loc_440072
mov	dword ptr [edi+48h], 3CA3D70Ah
mov	dword ptr [edi+4Ch], 3DCCCCCDh
mov	[edi+50h], ebx
mov	dword ptr flt_47CA48, 3F99999Ah
jmp	short loc_4400AC
; ---------------------------------------------------------------------------

loc_440072:				; CODE XREF: sub_43FF60+F3j
mov	dword ptr [edi+48h], 3DCCCCCDh
mov	dword ptr [edi+4Ch], 3C23D70Ah
mov	[edi+50h], ebx
cmp	word ptr [esi+2], 110h
jnz	short loc_440097
mov	dword ptr flt_47CA48, 3F99999Ah
jmp	short loc_4400AC
; ---------------------------------------------------------------------------

loc_440097:				; CODE XREF: sub_43FF60+129j
fld	dword ptr flt_478700
fdiv	dword ptr [esi+8]
fadd	dword ptr flt_4786B8
fstp	dword ptr flt_47CA48

loc_4400AC:				; CODE XREF: sub_43FF60+110j
					; sub_43FF60+135j
mov	al, [esi+100h]
lea	ebp, [esi+120h]
test	al, al
lea	ebx, [esi+114h]
lea	eax, [esi+108h]
jz	short loc_4400D9
mov	ecx, [esp+1Ch+arg_4]
mov	edx, [esi+104h]
push	ecx
push	ebp
push	ebx
push	eax
push	edx
jmp	short loc_4400E3
; ---------------------------------------------------------------------------

loc_4400D9:				; CODE XREF: sub_43FF60+166j
push	0
push	ebp
push	ebx
push	eax
push	offset dword_688D5A8

loc_4400E3:				; CODE XREF: sub_43FF60+177j
mov	ecx, edi
call	sub_40FA40
mov	eax, [esi+54h]
mov	ecx, [esi+6Ch]
mov	edx, [esi+68h]
push	0FFFFFFFFh			; int
push	eax				; int
mov	eax, [esi+64h]
push	ecx				; float
mov	ecx, [esi+60h]
push	edx				; float
mov	edx, [esi+158h]
push	eax				; float
push	ecx				; int
push	edx				; alpha
push	40h				; int
mov	ecx, edi
call	sub_4107C0
cmp	byte ptr [esi+78h], 4
jnz	short loc_440137
mov	dword ptr [edi+48h], 3E23D70Ah
mov	dword ptr [edi+4Ch], 3F333333h
mov	dword ptr [edi+50h], 0
mov	dword ptr flt_47CA48, 3F8A3D71h
jmp	short loc_440175
; ---------------------------------------------------------------------------

loc_440137:				; CODE XREF: sub_43FF60+1B4j
mov	dword ptr [edi+48h], 3F333333h
mov	dword ptr [edi+4Ch], 3D8F5C29h
mov	dword ptr [edi+50h], 0
cmp	word ptr [esi+2], 110h
jnz	short loc_440160
mov	dword ptr flt_47CA48, 3F8A3D71h
jmp	short loc_440175
; ---------------------------------------------------------------------------

loc_440160:				; CODE XREF: sub_43FF60+1F2j
fld	dword ptr flt_47888C
fdiv	dword ptr [esi+8]
fadd	dword ptr flt_4786B8
fstp	dword ptr flt_47CA48

loc_440175:				; CODE XREF: sub_43FF60+1D5j
					; sub_43FF60+1FEj
mov	al, [esi+100h]
test	al, al
jz	short loc_440196
mov	eax, [esp+1Ch+arg_4]
mov	ecx, [esi+104h]
push	eax
push	ebp
lea	eax, [esi+108h]
push	ebx
push	eax
push	ecx
jmp	short loc_4401A6
; ---------------------------------------------------------------------------

loc_440196:				; CODE XREF: sub_43FF60+21Dj
push	0
push	ebp
lea	eax, [esi+108h]
push	ebx
push	eax
push	offset dword_688D5A8

loc_4401A6:				; CODE XREF: sub_43FF60+234j
mov	ecx, edi
call	sub_40FA40
mov	edx, [esi+54h]
mov	eax, [esi+6Ch]
mov	ecx, [esi+68h]
push	0FFFFFFFFh			; int
push	edx				; int
mov	edx, [esi+64h]
push	eax				; float
mov	eax, [esi+60h]
push	ecx				; float
mov	ecx, [esi+158h]
push	edx				; float
push	eax				; int
push	ecx				; alpha
push	40h				; int
mov	ecx, edi
call	sub_4107C0
push	edi
push	esi
call	sub_43FE90
add	esp, 8
mov	dword ptr flt_47CA48, 3F800000h
xor	ebx, ebx

loc_4401E9:				; CODE XREF: sub_43FF60+E4j
mov	al, [esi+100h]
test	al, al
jz	short loc_440216
mov	edx, [esp+1Ch+arg_4]
lea	eax, [esi+120h]
push	edx
lea	ecx, [esi+114h]
push	eax
mov	eax, [esi+104h]
lea	edx, [esi+108h]
push	ecx
push	edx
push	eax
jmp	short loc_440231
; ---------------------------------------------------------------------------

loc_440216:				; CODE XREF: sub_43FF60+291j
lea	ecx, [esi+120h]
push	ebx
lea	edx, [esi+114h]
push	ecx
lea	eax, [esi+108h]
push	edx
push	eax
push	offset dword_688D5A8

loc_440231:				; CODE XREF: sub_43FF60+2B4j
mov	ecx, edi
call	sub_40FA40
cmp	dword ptr dword_7C41CC0, ebx
jnz	short loc_44024A
cmp	dword ptr [esi+54h], 0FFFFFFFEh
jz	loc_440689

loc_44024A:				; CODE XREF: sub_43FF60+2DEj
cmp	byte ptr [esi+70h], 80h
jnz	short loc_440281
mov	ecx, [esi+54h]
mov	edx, [esi+6Ch]
mov	eax, [esi+68h]
push	0FFFFFFFFh			; int
push	ecx				; int
mov	ecx, [esi+64h]
push	edx				; float
mov	edx, [esi+60h]
push	eax				; float
mov	eax, [esi+158h]
push	ecx				; float
push	edx				; int
push	eax				; alpha
push	82h				; int
mov	ecx, edi
call	sub_4107C0
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_440281:				; CODE XREF: sub_43FF60+2EEj
mov	ax, [esi+2]
cmp	ax, 10Ah
jnz	loc_440313
mov	ebp, 3F800000h
mov	dword ptr [edi+48h], 3ECCCCCDh
mov	dword ptr [edi+4Ch], 3F19999Ah
mov	[edi+50h], ebp
mov	byte ptr [edi+88h], 0
mov	ecx, [esi+54h]
mov	edx, [esi+6Ch]
mov	eax, [esi+68h]
push	460h				; int
push	ecx				; int
mov	ecx, [esi+64h]
push	edx				; float
mov	edx, [esi+60h]
push	eax				; float
mov	eax, [esi+158h]
push	ecx				; float
push	edx				; int
push	eax				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0
mov	[edi+48h], ebp
mov	[edi+4Ch], ebp
mov	[edi+50h], ebp
mov	byte ptr [edi+88h], 0FFh
mov	ecx, [esi+54h]
mov	edx, [esi+6Ch]
mov	eax, [esi+68h]
push	0FFFFFFFFh			; int
push	ecx				; int
mov	ecx, [esi+64h]
push	edx				; float
mov	edx, [esi+60h]
push	eax				; float
mov	eax, [esi+158h]
push	ecx				; float
push	edx				; int
push	eax				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_440313:				; CODE XREF: sub_43FF60+329j
mov	ecx, dword ptr dword_81C1528
cmp	ecx, ebx
jnz	loc_4403B0
cmp	ax, 69h
jnz	loc_440531
mov	ecx, [esi+158h]
push	ecx
mov	ecx, edi
call	sub_410230
mov	edx, [esi+64h]
mov	eax, [esi+60h]
mov	ecx, [esi+158h]
push	0FFFFFFFFh			; int
push	ebx				; float
push	ebx				; float
push	edx				; float
push	eax				; int
push	ecx				; alpha
push	2				; int
push	ebx				; int
mov	ecx, edi
call	sub_410240
mov	edx, [esi+64h]
mov	eax, [esi+60h]
mov	ecx, [esi+158h]
push	0FFFFFFFFh			; int
push	ebx				; float
push	ebx				; float
push	edx				; float
push	eax				; int
push	ecx				; alpha
push	2				; int
push	1				; int
mov	ecx, edi
call	sub_410240
mov	edx, [esi+64h]
mov	eax, [esi+60h]
mov	ecx, [esi+158h]
push	0FFFFFFFFh			; int
push	ebx				; float
push	ebx				; float
push	edx				; float
push	eax				; int
push	ecx				; alpha
push	2				; int
push	2				; int
mov	ecx, edi
call	sub_410240
mov	edx, [esi+6Ch]
mov	eax, [esi+68h]
mov	ecx, [esi+64h]
push	0FFFFFFFFh
push	edx
mov	edx, [esi+158h]
push	eax
push	ecx
push	3
push	edx
push	2
jmp	loc_440679
; ---------------------------------------------------------------------------

loc_4403B0:				; CODE XREF: sub_43FF60+3BBj
cmp	ecx, 4
jnz	loc_440531
cmp	ax, 17h
jz	short loc_4403DA
cmp	ax, 13h
jz	short loc_4403DA
cmp	ax, 14h
jz	short loc_4403DA
cmp	ax, 3
jz	short loc_4403DA
cmp	ax, cx
jnz	loc_440531

loc_4403DA:				; CODE XREF: sub_43FF60+45Dj
					; sub_43FF60+463j ...
call	_rand
mov	ax, [esi+2]
cmp	ax, 17h
jnz	short loc_440417

loc_4403E9:				; CODE XREF: sub_43FF60+551j
					; sub_43FF60+5CCj
mov	eax, [esi+54h]
mov	ecx, [esi+6Ch]
mov	edx, [esi+68h]
push	0FFFFFFFFh			; int
push	eax				; int
mov	eax, [esi+64h]
push	ecx				; float
mov	ecx, [esi+60h]
push	edx				; float
mov	edx, [esi+158h]
push	eax				; float
push	ecx				; int
push	edx				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_440417:				; CODE XREF: sub_43FF60+487j
cmp	ax, 13h
jz	loc_4404B6
cmp	ax, 14h
jz	loc_4404B6
cmp	ax, 3
jz	short loc_44043B
cmp	ax, 4
jnz	loc_440689

loc_44043B:				; CODE XREF: sub_43FF60+4CFj
mov	eax, [edi+48h]
mov	ecx, [edi+4Ch]
mov	edx, [edi+50h]
mov	[esp+1Ch+var_C], eax
mov	dword ptr [edi+48h], 3F800000h
mov	dword ptr [edi+4Ch], 3E4CCCCDh
mov	dword ptr [edi+50h], 3DCCCCCDh
mov	byte ptr [edi+88h], 1
mov	eax, [esi+54h]
mov	[esp+1Ch+var_8], ecx
mov	ecx, [esi+6Ch]
mov	[esp+1Ch+var_4], edx
mov	edx, [esi+68h]
push	460h				; int
push	eax				; int
mov	eax, [esi+64h]
push	ecx				; float
mov	ecx, [esi+60h]
push	edx				; float
mov	edx, [esi+158h]
push	eax				; float
push	ecx				; int
push	edx				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0
mov	eax, [esp+1Ch+var_C]
mov	ecx, [esp+1Ch+var_8]
mov	edx, [esp+1Ch+var_4]
mov	[edi+48h], eax
mov	[edi+4Ch], ecx
mov	[edi+50h], edx
mov	byte ptr [edi+88h], 0FFh
jmp	loc_4403E9
; ---------------------------------------------------------------------------

loc_4404B6:				; CODE XREF: sub_43FF60+4BBj
					; sub_43FF60+4C5j
mov	eax, [edi+48h]
mov	ecx, [edi+4Ch]
mov	edx, [edi+50h]
mov	[esp+1Ch+var_C], eax
mov	dword ptr [edi+48h], 3F800000h
mov	dword ptr [edi+4Ch], 3E4CCCCDh
mov	dword ptr [edi+50h], 3DCCCCCDh
mov	byte ptr [edi+88h], 2
mov	eax, [esi+54h]
mov	[esp+1Ch+var_8], ecx
mov	ecx, [esi+6Ch]
mov	[esp+1Ch+var_4], edx
mov	edx, [esi+68h]
push	460h				; int
push	eax				; int
mov	eax, [esi+64h]
push	ecx				; float
mov	ecx, [esi+60h]
push	edx				; float
mov	edx, [esi+158h]
push	eax				; float
push	ecx				; int
push	edx				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0
mov	eax, [esp+1Ch+var_C]
mov	ecx, [esp+1Ch+var_8]
mov	edx, [esp+1Ch+var_4]
mov	[edi+48h], eax
mov	[edi+4Ch], ecx
mov	[edi+50h], edx
mov	byte ptr [edi+88h], 0FFh
jmp	loc_4403E9
; ---------------------------------------------------------------------------

loc_440531:				; CODE XREF: sub_43FF60+3C5j
					; sub_43FF60+453j ...
mov	al, [esi+71h]
mov	ebp, 3F800000h
mov	cl, al
and	cl, 1
cmp	cl, 1
jnz	short loc_440578
mov	dl, al
and	dl, 2
cmp	dl, 2
jnz	short loc_440560
mov	dword ptr [edi+48h], 3E99999Ah
mov	[edi+4Ch], ebp
mov	dword ptr [edi+50h], 3F4CCCCDh
jmp	short loc_44058F
; ---------------------------------------------------------------------------

loc_440560:				; CODE XREF: sub_43FF60+5EBj
cmp	cl, 1
jnz	short loc_440578
mov	dword ptr [edi+48h], 3E99999Ah
mov	[edi+4Ch], ebp
mov	dword ptr [edi+50h], 3F000000h
jmp	short loc_44058F
; ---------------------------------------------------------------------------

loc_440578:				; CODE XREF: sub_43FF60+5E1j
					; sub_43FF60+603j
and	al, 2
cmp	al, 2
jnz	short loc_44058F
mov	dword ptr [edi+48h], 3E99999Ah
mov	dword ptr [edi+4Ch], 3F000000h
mov	[edi+50h], ebp

loc_44058F:				; CODE XREF: sub_43FF60+5FEj
					; sub_43FF60+616j ...
mov	eax, [esi+54h]
mov	ecx, [esi+6Ch]
mov	edx, [esi+68h]
push	0FFFFFFFFh			; int
push	eax				; int
mov	eax, [esi+64h]
push	ecx				; float
mov	ecx, [esi+60h]
push	edx				; float
mov	edx, [esi+158h]
push	eax				; float
push	ecx				; int
push	edx				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0
mov	al, [esi+71h]
and	al, 2
cmp	al, 2
jnz	short loc_4405DF
mov	ecx, [esi+54h]
mov	edx, [esi+6Ch]
mov	eax, [esi+68h]
push	0FFFFFFFFh			; int
push	ecx				; int
mov	ecx, [esi+158h]
push	edx				; float
push	eax				; float
push	ebp				; float
push	0FFFFFFFEh			; int
push	ecx				; alpha
push	2				; int
mov	ecx, edi
call	sub_4107C0

loc_4405DF:				; CODE XREF: sub_43FF60+65Cj
cmp	word ptr [esi+2], 115h
jnz	loc_440689
mov	edx, [esi+158h]
mov	ecx, edi
push	edx
call	sub_410230
fld	dword ptr flt_5727448
fmul	dword ptr flt_4787E8
mov	eax, [edi+38h]
mov	edx, [esi+6Ch]
fsin
movsx	ecx, word ptr [eax+0Ch]
mov	eax, [esi+68h]
push	ecx				; int
mov	ecx, [esi+158h]
push	edx				; float
push	eax				; float
fmul	dword ptr flt_478758
fadd	dword ptr flt_4786E0
fstp	[esp+28h+arg_8]
mov	ebx, [esp+28h+arg_8]
push	ebx				; float
push	0				; int
push	ecx				; alpha
push	2				; int
push	0				; int
mov	ecx, edi
call	sub_410240
fld	dword ptr flt_5727448
push	0FFFFFFFFh			; int
call	__ftol
cdq
mov	ecx, 64h
idiv	ecx
mov	eax, [esi+158h]
push	ecx
mov	[esp+24h+arg_8], edx
mov	edx, [esi+68h]
fild	[esp+24h+arg_8]
fmul	dword ptr flt_478754
fchs
fstp	[esp+24h+var_24]		; float
push	edx				; float
push	ebx				; float
push	3				; int
push	eax				; alpha
push	44h				; int

loc_440679:				; CODE XREF: sub_43FF60+44Bj
push	3				; int
mov	ecx, edi
call	sub_410240
mov	ecx, edi
call	glPopMatrix

loc_440689:				; CODE XREF: sub_43FF60+1Cj
					; sub_43FF60+2E4j ...
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
sub_43FF60 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4406A0 proc	near			; CODE XREF: sub_4411D0+E7p

var_58=	dword ptr -58h
var_4C=	dword ptr -4Ch
var_34=	dword ptr -34h
var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	byte ptr -24h
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

sub	esp, 34h
push	ebx
push	ebp
push	esi
mov	esi, [esp+40h+arg_0]
push	edi
movsx	eax, word ptr [esi+2]
lea	ecx, [eax+eax*2]
shl	ecx, 3
sub	ecx, eax
lea	edi, byte_5729398[ecx*8]
call	_rand
cdq
mov	ecx, 1Eh
idiv	ecx
mov	eax, dword ptr nScene_482904
add	edx, 46h
cmp	eax, 2
mov	[esp+44h+arg_0], edx
fild	[esp+44h+arg_0]
fmul	dword ptr flt_478754
fstp	[esp+44h+arg_0]
jnz	loc_4407A7
cmp	word ptr [esi+2], 3Ch
jnz	loc_4407A7
fld	[esp+44h+arg_0]
fmul	dword ptr flt_4786E0
mov	edx, [esp+44h+arg_0]
lea	eax, [esp+44h+var_24]
push	0
lea	ecx, [esp+48h+var_18]
push	eax
push	ecx
fstp	[esp+50h+var_2C]
fld	[esp+50h+arg_0]
fmul	dword ptr flt_47870C
push	offset dword_688D728
mov	ecx, edi
mov	[esp+54h+var_30], edx
mov	[esp+54h+var_18], 0
mov	[esp+54h+var_14], 0
mov	[esp+54h+var_10], 0
fstp	[esp+54h+var_28]
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3F800000h
push	eax
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	ecx, [esp+44h+var_24]
lea	edx, [esp+44h+var_18]
push	0
push	ecx
push	edx
push	offset dword_688D758
mov	ecx, edi
call	sub_40FEA0
push	0
push	0
lea	eax, [esp+4Ch+var_30]
push	esi
push	eax
lea	ecx, [esp+54h+var_24]
push	3F800000h
push	ecx
push	44Ch
call	sub_41B9C0
add	esp, 1Ch

loc_4407A7:				; CODE XREF: sub_4406A0+48j
					; sub_4406A0+53j
mov	eax, dword ptr dword_81C1528
mov	[esp+44h+var_18], 0
cmp	eax, 6				; switch 7 cases
mov	[esp+44h+var_14], 0
mov	[esp+44h+var_10], 0
ja	loc_44115E			; jumptable 004407CD default case
jmp	ds:off_441168[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_4407D4:				; CODE XREF: sub_4406A0+12Dj
					; DATA XREF: .text:off_441168o
movsx	eax, word ptr [esi+2]		; jumptable 004407CD case 0
cmp	eax, 38h
jz	loc_440939
cmp	eax, 69h
jnz	loc_44115E			; jumptable 004407CD default case
mov	dword ptr [esi+64h], 3F800000h
fld	dword ptr flt_5727448
call	__ftol
neg	eax
cdq
mov	ecx, 3E8h
idiv	ecx
mov	[esp+44h+arg_0], edx
fild	[esp+44h+arg_0]
fmul	dword ptr flt_478894
fstp	dword ptr [esi+6Ch]
call	_rand
and	eax, 80000001h
jns	short loc_440828
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_440828:				; CODE XREF: sub_4406A0+181j
jnz	loc_44115E			; jumptable 004407CD default case
call	_rand
and	eax, 8000001Fh
jns	short loc_44083F
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_44083F:				; CODE XREF: sub_4406A0+198j
sub	eax, 10h
mov	[esp+44h+var_14], 0C1A00000h
mov	[esp+44h+arg_0], eax
fild	[esp+44h+arg_0]
fstp	[esp+44h+var_18]
call	_rand
and	eax, 8000001Fh
jns	short loc_440867
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_440867:				; CODE XREF: sub_4406A0+1C0j
sub	eax, 10h
lea	edx, [esp+44h+var_24]
mov	[esp+44h+arg_0], eax
push	0
fild	[esp+48h+arg_0]
lea	eax, [esp+48h+var_18]
push	edx
push	eax
push	offset dword_688D5D8
fstp	[esp+54h+var_10]
mov	ecx, edi
call	sub_40FEA0
push	0
lea	ebx, [esi+0D8h]
push	3F800000h
add	esi, 18h
push	0
push	ebx
lea	ecx, [esp+54h+var_24]
push	esi
push	ecx
push	492h
call	sub_4212F0
add	esp, 1Ch
call	_rand
and	eax, 8000001Fh
jns	short loc_4408C5
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_4408C5:				; CODE XREF: sub_4406A0+21Ej
sub	eax, 10h
mov	[esp+44h+var_14], 0C2A00000h
mov	[esp+44h+arg_0], eax
fild	[esp+44h+arg_0]
fstp	[esp+44h+var_18]
call	_rand
and	eax, 8000001Fh
jns	short loc_4408ED
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_4408ED:				; CODE XREF: sub_4406A0+246j
sub	eax, 10h
lea	edx, [esp+44h+var_24]
mov	[esp+44h+arg_0], eax
push	0
fild	[esp+48h+arg_0]
lea	eax, [esp+48h+var_18]
push	edx
push	eax
push	offset dword_688D668
fstp	[esp+54h+var_10]
mov	ecx, edi
call	sub_40FEA0
push	0
push	3F800000h
push	0
push	ebx
lea	ecx, [esp+54h+var_24]
push	esi
push	ecx
push	492h
call	sub_4212F0
add	esp, 1Ch
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 34h
retn
; ---------------------------------------------------------------------------

loc_440939:				; CODE XREF: sub_4406A0+13Bj
fld	[esp+44h+arg_0]
fmul	dword ptr flt_478764
lea	edx, [esp+44h+var_18]
push	0
lea	eax, [esp+48h+var_24]
push	edx
push	eax
push	offset dword_688DEA8
fstp	[esp+54h+var_34]
fld	[esp+54h+arg_0]
fmul	dword ptr flt_4787DC
mov	ecx, edi
fstp	[esp+54h+var_30]
fld	[esp+54h+arg_0]
fmul	dword ptr flt_478758
fstp	[esp+54h+var_2C]
fld	[esp+54h+arg_0]
fmul	dword ptr flt_478700
fstp	[esp+54h+var_28]
call	sub_40FEA0
mov	ebx, [esp+44h+var_34]
push	0
push	0
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
lea	edx, [esp+54h+var_18]
push	ebx
push	edx
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	eax, [esp+44h+var_18]
lea	ecx, [esp+44h+var_24]
push	0
push	eax
push	ecx
push	offset dword_688E058
mov	ecx, edi
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_18]
push	ebx
push	eax
jmp	loc_441151
; ---------------------------------------------------------------------------

loc_4409D7:				; CODE XREF: sub_4406A0+12Dj
					; DATA XREF: .text:off_441168o
cmp	word ptr [esi+2], 64h		; jumptable 004407CD case 2
jnz	loc_44115E			; jumptable 004407CD default case
fld	dword ptr flt_5727448
mov	ecx, [esp+44h+arg_0]
fmul	dword ptr flt_478700
mov	edx, ecx
mov	eax, ecx
mov	[esp+44h+var_30], ecx
mov	[esp+44h+var_2C], edx
mov	[esp+44h+var_28], eax
call	__ftol
cdq
mov	ecx, 168h
push	0
idiv	ecx
lea	eax, [esp+48h+var_18]
mov	ecx, edi
mov	[esp+48h+var_18], 0
mov	[esp+48h+var_14], 0
mov	[esp+48h+var_10], 43160000h
mov	[esp+48h+arg_0], edx
lea	edx, [esp+48h+var_24]
fild	[esp+48h+arg_0]
push	edx
push	eax
push	offset dword_688D5A8
fstp	[esp+54h+var_34]
call	sub_40FEA0
mov	ecx, [esp+44h+var_34]
push	0
push	ecx
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	40200000h
push	eax
push	475h
call	sub_41B9C0
fld	[esp+60h+var_34]
add	esp, 1Ch
lea	edx, [esp+44h+var_24]
fchs
push	0
push	ecx
lea	ecx, [esp+4Ch+var_30]
fstp	[esp+4Ch+var_4C]
push	esi
push	ecx
push	40200000h
push	edx
push	475h
call	sub_41B9C0
add	esp, 1Ch
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 34h
retn
; ---------------------------------------------------------------------------

loc_440AA0:				; CODE XREF: sub_4406A0+12Dj
					; DATA XREF: .text:off_441168o
movsx	eax, word ptr [esi+2]		; jumptable 004407CD case 3
dec	eax
cmp	eax, 26h			; switch 39 cases
ja	loc_44115E			; jumptable 004407CD default case
xor	ecx, ecx
mov	cl, ds:byte_44119C[eax]
jmp	ds:off_441184[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_440ABD:				; CODE XREF: sub_4406A0+416j
					; DATA XREF: .text:off_441184o
fld	[esp+44h+arg_0]			; jumptable 00440AB6 case 8
fmul	dword ptr flt_47874C
mov	edx, [esp+44h+arg_0]
lea	eax, [esp+44h+var_24]
push	0
lea	ecx, [esp+48h+var_18]
push	eax
push	ecx
fstp	[esp+50h+var_30]
fld	[esp+50h+arg_0]
fmul	dword ptr flt_4787E4
push	offset dword_688D5D8
mov	ecx, edi
mov	[esp+54h+var_28], edx
fstp	[esp+54h+var_2C]
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3FC00000h
push	eax
jmp	loc_441151
; ---------------------------------------------------------------------------

loc_440B12:				; CODE XREF: sub_4406A0+416j
					; DATA XREF: .text:off_441184o
fld	[esp+44h+arg_0]			; jumptable 00440AB6 case 34
fmul	dword ptr flt_47874C
mov	ecx, [esp+44h+arg_0]
lea	edx, [esp+44h+var_24]
push	0
lea	eax, [esp+48h+var_18]
push	edx
mov	[esp+4Ch+var_28], ecx
fstp	[esp+4Ch+var_30]
fld	[esp+4Ch+arg_0]
fmul	dword ptr flt_4787E4
push	eax
push	offset dword_688D638
mov	ecx, edi
fstp	[esp+54h+var_2C]
call	sub_40FEA0
push	0
push	0
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
push	3FC00000h
lea	edx, [esp+58h+var_24]
jmp	loc_441150
; ---------------------------------------------------------------------------

loc_440B66:				; CODE XREF: sub_4406A0+416j
					; DATA XREF: .text:off_441184o
fld	[esp+44h+arg_0]			; jumptable 00440AB6 case 0
fmul	dword ptr flt_47874C
mov	eax, [esp+44h+arg_0]
lea	ecx, [esp+44h+var_24]
push	0
lea	edx, [esp+48h+var_18]
push	ecx
push	edx
fstp	[esp+50h+var_30]
fld	[esp+50h+arg_0]
fmul	dword ptr flt_4787E4
push	offset dword_688D608
mov	ecx, edi
mov	[esp+54h+var_28], eax
fstp	[esp+54h+var_2C]
call	sub_40FEA0
push	0
push	0
lea	eax, [esp+4Ch+var_30]
push	esi
push	eax
lea	ecx, [esp+54h+var_24]
push	3F000000h
push	ecx
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	edx, [esp+44h+var_24]
lea	eax, [esp+44h+var_18]
mov	ecx, edi
push	0
push	edx
push	eax
push	offset dword_688D668
call	sub_40FEA0
push	0
push	0
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
lea	edx, [esp+54h+var_24]
push	3F000000h
push	edx
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	eax, [esp+44h+var_24]
lea	ecx, [esp+44h+var_18]
push	0
push	eax
push	ecx
push	offset dword_688D6C8
mov	ecx, edi
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3F000000h
push	eax
jmp	loc_441151
; ---------------------------------------------------------------------------

loc_440C2D:				; CODE XREF: sub_4406A0+416j
					; DATA XREF: .text:off_441184o
fld	[esp+44h+arg_0]			; jumptable 00440AB6 case 16
fmul	dword ptr flt_47874C
mov	ecx, [esp+44h+arg_0]
lea	edx, [esp+44h+var_24]
push	0
lea	eax, [esp+48h+var_18]
push	edx
mov	[esp+4Ch+var_28], ecx
fstp	[esp+4Ch+var_30]
fld	[esp+4Ch+arg_0]
fmul	dword ptr flt_4787E4
push	eax
push	offset dword_688D668
mov	ecx, edi
fstp	[esp+54h+var_2C]
call	sub_40FEA0
push	0
push	0
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
lea	edx, [esp+54h+var_24]
push	3F800000h
push	edx
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	eax, [esp+44h+var_24]
lea	ecx, [esp+44h+var_18]
push	0
push	eax
push	ecx
push	offset dword_688D6F8
mov	ecx, edi
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3F800000h
push	eax
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	ecx, [esp+44h+var_24]
lea	edx, [esp+44h+var_18]
push	0
push	ecx
push	edx
push	offset dword_688D788
mov	ecx, edi
call	sub_40FEA0
push	0
push	0
lea	eax, [esp+4Ch+var_30]
push	esi
push	eax
lea	ecx, [esp+54h+var_24]
push	3F800000h
push	ecx
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
lea	edx, [esp+44h+var_24]
lea	eax, [esp+44h+var_18]
mov	ecx, edi
push	0
push	edx
push	eax
push	offset dword_688D818
call	sub_40FEA0
push	0
push	0
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
push	3F800000h
lea	edx, [esp+58h+var_24]
jmp	loc_441150
; ---------------------------------------------------------------------------

loc_440D2C:				; CODE XREF: sub_4406A0+416j
					; DATA XREF: .text:off_441184o
fld	[esp+44h+arg_0]			; jumptable 00440AB6 case 38
fmul	dword ptr flt_47874C
mov	eax, [esp+44h+arg_0]
mov	[esp+44h+var_28], eax
fstp	[esp+44h+var_30]
fld	[esp+44h+arg_0]
fmul	dword ptr flt_478750
fstp	[esp+44h+var_2C]
fld	dword ptr flt_5727448
fmul	dword ptr flt_478700
call	__ftol
cdq
mov	ecx, 168h
push	0
idiv	ecx
lea	eax, [esp+48h+var_18]
mov	ecx, edi
mov	[esp+48h+arg_0], edx
lea	edx, [esp+48h+var_24]
fild	[esp+48h+arg_0]
push	edx
push	eax
push	offset dword_688E058
fstp	[esp+54h+var_34]
call	sub_40FEA0
mov	ecx, [esp+44h+var_34]
push	0
push	ecx
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3F800000h
push	eax
push	475h
call	sub_41B9C0
fld	[esp+60h+var_34]
add	esp, 1Ch
lea	edx, [esp+44h+var_24]
fchs
push	0
push	ecx
lea	ecx, [esp+4Ch+var_30]
fstp	[esp+4Ch+var_4C]
push	esi
push	ecx
push	3F800000h
push	edx
push	475h
call	sub_41B9C0
add	esp, 1Ch
mov	[esp+44h+var_30], 3F800000h
mov	[esp+44h+var_2C], 3F800000h
mov	[esp+44h+var_28], 3F800000h
mov	ebp, offset dword_688E118

loc_440DF7:				; CODE XREF: sub_4406A0+7EAj
lea	eax, [esp+44h+var_24]
push	0
lea	ecx, [esp+48h+var_18]
push	eax
push	ecx
push	ebp
mov	ecx, edi
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3F800000h
push	eax
push	44Ch
call	sub_41B9C0
add	esp, 1Ch
call	_rand
and	eax, 8000001Fh
jns	short loc_440E3D
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_440E3D:				; CODE XREF: sub_4406A0+796j
jnz	short loc_440E81
push	0
push	3F800000h
lea	ecx, [esp+4Ch+var_30]
lea	ebx, [esi+18h]
push	0
push	ecx
lea	edx, [esp+54h+var_24]
push	ebx
push	edx
push	49Ch
call	sub_4212F0
push	0
push	3F800000h
lea	eax, [esp+68h+var_30]
push	1
push	eax
lea	ecx, [esp+70h+var_24]
push	ebx
push	ecx
push	49Ch
call	sub_4212F0
add	esp, 38h

loc_440E81:				; CODE XREF: sub_4406A0:loc_440E3Dj
add	ebp, 30h
cmp	ebp, offset dword_688E1D8
jle	loc_440DF7
lea	edx, [esp+44h+var_24]
push	0
lea	eax, [esp+48h+var_18]
push	edx
push	eax
push	offset dword_688E088
mov	ecx, edi
call	sub_40FEA0
call	_rand
and	eax, 80000007h
jns	short loc_440EB9
dec	eax
or	eax, 0FFFFFFF8h
inc	eax

loc_440EB9:				; CODE XREF: sub_4406A0+812j
jnz	loc_44115E			; jumptable 004407CD default case
mov	esi, 8

loc_440EC4:				; CODE XREF: sub_4406A0+8AAj
call	_rand
cdq
mov	ecx, 3Ch
mov	[esp+44h+var_8], 430C0000h
idiv	ecx
add	edx, ecx
mov	[esp+44h+arg_0], edx
fild	[esp+44h+arg_0]
fstp	[esp+44h+var_C]
call	_rand
cdq
mov	ecx, 1Eh
push	0FFFFFFFFh
idiv	ecx
push	41200000h
push	0
push	0
lea	eax, [esp+54h+var_24]
lea	ecx, [esp+54h+var_24]
mov	[esp+54h+arg_0], edx
lea	edx, [esp+54h+var_C]
fild	[esp+54h+arg_0]
push	edx
push	eax
push	ecx
push	4B6h
fstp	[esp+64h+var_4]
call	sub_422DA0
push	0
push	3F800000h
lea	edx, [esp+6Ch+var_30]
push	0
lea	eax, [esp+70h+var_C]
push	edx
lea	ecx, [esp+74h+var_24]
push	eax
push	ecx
push	465h
call	sub_4212F0
add	esp, 3Ch
dec	esi
jnz	loc_440EC4
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 34h
retn
; ---------------------------------------------------------------------------

loc_440F58:				; CODE XREF: sub_4406A0+12Dj
					; DATA XREF: .text:off_441168o
mov	ax, [esi+2]			; jumptable 004407CD case 4
movsx	ecx, ax
cmp	ecx, 13h
jl	loc_4410EB			; jumptable 004407CD case 6
cmp	ecx, 14h
jg	loc_4410EB			; jumptable 004407CD case 6
cmp	ax, 13h
jnz	short loc_440F9C
fld	[esp+44h+arg_0]
fmul	dword ptr flt_47870C
mov	edx, [esp+44h+arg_0]
mov	ebx, 4BBh
mov	[esp+44h+var_30], edx
mov	[esp+44h+var_28], 0
fstp	[esp+44h+var_2C]
jmp	short loc_440FC5
; ---------------------------------------------------------------------------

loc_440F9C:				; CODE XREF: sub_4406A0+8D5j
fld	[esp+44h+arg_0]
fmul	dword ptr flt_47874C
mov	eax, [esp+44h+arg_0]
mov	ebx, 475h
mov	[esp+44h+var_28], eax
fstp	[esp+44h+var_30]
fld	[esp+44h+arg_0]
fmul	dword ptr flt_478750
fstp	[esp+44h+var_2C]

loc_440FC5:				; CODE XREF: sub_4406A0+8FAj
fld	dword ptr flt_5727448
fmul	dword ptr flt_478700
call	__ftol
cdq
mov	ecx, 168h
push	0
idiv	ecx
lea	eax, [esp+48h+var_18]
mov	ecx, edi
mov	[esp+48h+var_34], edx
lea	edx, [esp+48h+var_24]
fild	[esp+48h+var_34]
push	edx
push	eax
push	offset dword_688D878
fstp	[esp+54h+var_34]
call	sub_40FEA0
mov	ebp, [esp+44h+var_34]
push	0
push	ebp
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
lea	edx, [esp+54h+var_24]
push	3E99999Ah
push	edx
push	ebx
call	sub_41B9C0
fld	[esp+60h+var_34]
fchs
fstp	[esp+60h+var_34]
mov	eax, [esp+60h+var_34]
push	0
push	eax
lea	ecx, [esp+68h+var_30]
push	esi
push	ecx
lea	edx, [esp+70h+var_24]
push	3E99999Ah
push	edx
push	ebx
call	sub_41B9C0
add	esp, 38h
lea	eax, [esp+44h+var_24]
lea	ecx, [esp+44h+var_18]
push	0
push	eax
push	ecx
push	offset dword_688D938
mov	ecx, edi
call	sub_40FEA0
push	0
push	ebp
lea	edx, [esp+4Ch+var_30]
push	esi
push	edx
lea	eax, [esp+54h+var_24]
push	3E99999Ah
push	eax
push	ebx
call	sub_41B9C0
mov	ecx, [esp+60h+var_34]
push	0
push	ecx
lea	edx, [esp+68h+var_30]
push	esi
push	edx
lea	eax, [esp+70h+var_24]
push	3E99999Ah
push	eax
push	ebx
call	sub_41B9C0
add	esp, 38h
lea	ecx, [esp+44h+var_24]
lea	edx, [esp+44h+var_18]
push	0
push	ecx
push	edx
push	offset dword_688D998
mov	ecx, edi
call	sub_40FEA0
push	0
push	ebp
lea	eax, [esp+4Ch+var_30]
push	esi
push	eax
lea	ecx, [esp+54h+var_24]
push	3FC00000h
push	ecx
push	ebx
call	sub_41B9C0
mov	edx, [esp+60h+var_34]
push	0
push	edx
lea	eax, [esp+68h+var_30]
push	esi
push	eax
lea	ecx, [esp+70h+var_24]
push	3FC00000h
push	ecx
push	ebx
call	sub_41B9C0
add	esp, 38h

loc_4410EB:				; CODE XREF: sub_4406A0+12Dj
					; sub_4406A0+8C2j ...
cmp	word ptr [esi+2], 9		; jumptable 004407CD case 6
jnz	short loc_44115E		; jumptable 004407CD default case
fld	[esp+44h+arg_0]
fmul	dword ptr flt_4787DC
lea	edx, [esp+44h+var_18]
push	0
lea	eax, [esp+48h+var_24]
push	edx
push	eax
push	offset dword_688D5D8
fstp	[esp+54h+var_30]
fld	[esp+54h+arg_0]
fmul	dword ptr flt_478758
mov	ecx, edi
fstp	[esp+54h+var_2C]
fld	[esp+54h+arg_0]
fmul	dword ptr flt_478700
fstp	[esp+54h+var_28]
call	sub_40FEA0
fld	[esp+44h+arg_0]
fmul	dword ptr flt_478764
push	0
push	0
lea	ecx, [esp+4Ch+var_30]
push	esi
push	ecx
push	ecx
fstp	[esp+58h+var_58]
lea	edx, [esp+58h+var_18]

loc_441150:				; CODE XREF: sub_4406A0+4C1j
					; sub_4406A0+687j
push	edx

loc_441151:				; CODE XREF: sub_4406A0+332j
					; sub_4406A0+46Dj ...
push	44Ch
call	sub_41B9C0
add	esp, 1Ch

loc_44115E:				; CODE XREF: sub_4406A0+127j
					; sub_4406A0+12Dj ...
pop	edi				; jumptable 004407CD default case
pop	esi
pop	ebp
pop	ebx
add	esp, 34h
retn
; ---------------------------------------------------------------------------
align 4
off_441168 dd offset loc_4407D4		; DATA XREF: sub_4406A0+12Dr
dd offset loc_44115E			; jump table for switch	statement
dd offset loc_4409D7
dd offset loc_440AA0
dd offset loc_440F58
dd offset loc_44115E
dd offset loc_4410EB
off_441184 dd offset loc_440B66		; DATA XREF: sub_4406A0+416r
dd offset loc_440ABD			; jump table for switch	statement
dd offset loc_440C2D
dd offset loc_440B12
dd offset loc_440D2C
dd offset loc_44115E
byte_44119C db	    0,	   5,	  5,	 5 ; DATA XREF:	sub_4406A0+410r
db	5,     5,     5,     5		; indirect table for switch statement
db	1,     5,     5,     5
db	5,     5,     5,     5
db	2,     5,     5,     5
db	5,     5,     5,     5
db	5,     5,     5,     5
db	5,     5,     5,     5
db	5,     5,     3,     5
db	5,     5,     4
sub_4406A0 endp

align 10h

; =============== S U B	R O U T	I N E =======================================


sub_4411D0 proc	near			; CODE XREF: sub_452CD0+6Ep
					; sub_454200:loc_4542D2p ...

var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 0Ch
push	ebx
push	ebp
push	esi
push	edi
mov	eax, offset dword_81BDE6C
mov	[esp+1Ch+var_C], 8

loc_4411E4:				; CODE XREF: sub_4411D0+126j
fild	[esp+1Ch+var_C]
mov	ebx, 8
mov	edi, eax
mov	[esp+1Ch+var_8], ebx
fstp	[esp+1Ch+var_4]
mov	ebp, [esp+1Ch+var_4]

loc_4411FB:				; CODE XREF: sub_4411D0+10Dj
fild	[esp+1Ch+var_8]
push	0C3340000h			; float
push	ecx
fstp	[esp+24h+var_24]		; float
push	ebp				; float
call	sub_43E450
add	esp, 0Ch
mov	[edi+8], al
test	al, al
jnz	short loc_441225
mov	al, byte_81C1815
test	al, al
jz	loc_4412CD

loc_441225:				; CODE XREF: sub_4411D0+46j
mov	esi, [edi]
test	esi, esi
jz	loc_4412CD

loc_44122F:				; CODE XREF: sub_4411D0+F7j
cmp	byte ptr [esi],	0
jz	loc_4412BF
fld	dword ptr [esi+10h]
mov	eax, [esi+0C0h]
fmul	dword ptr flt_478754
push	eax				; float
push	ecx
fstp	[esp+24h+var_24]		; float
fld	dword ptr [esi+0Ch]
fmul	dword ptr flt_478754
push	ecx
fstp	[esp+28h+var_28]		; float
call	sub_43E450
add	esp, 0Ch
mov	[esi+150h], al
test	al, al
jnz	short loc_441274
mov	al, byte_81C1815
test	al, al
jz	short loc_4412BF

loc_441274:				; CODE XREF: sub_4411D0+99j
cmp	dword ptr dword_81C1528, 2
jnz	short loc_4412AC
cmp	word ptr [esi+2], 64h
jnz	short loc_4412AC
mov	ecx, dword ptr dword_79DBE88
mov	al, [ecx+178h]
mov	ecx, dword ptr equNewData570h_7B786CC
sub	al, 3
neg	al
sbb	eax, eax
xor	edx, edx
mov	dx, [ecx+0Eh]
and	eax, 1Bh
add	eax, 35h
cmp	edx, eax
jl	short loc_4412BF

loc_4412AC:				; CODE XREF: sub_4411D0+ABj
					; sub_4411D0+B2j
push	0				; float
push	0				; int
push	esi				; int
call	sub_43FF60
push	esi
call	sub_4406A0
add	esp, 10h

loc_4412BF:				; CODE XREF: sub_4411D0+62j
					; sub_4411D0+A2j ...
mov	esi, [esi+174h]
test	esi, esi
jnz	loc_44122F

loc_4412CD:				; CODE XREF: sub_4411D0+4Fj
					; sub_4411D0+59j
add	ebx, 10h
add	edi, 10h
cmp	ebx, 108h
mov	[esp+1Ch+var_8], ebx
jl	loc_4411FB
mov	ecx, [esp+1Ch+var_C]
mov	eax, edi
add	ecx, 10h
cmp	ecx, 108h
mov	[esp+1Ch+var_C], ecx
jl	loc_4411E4
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
sub_4411D0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_441310 proc	near			; CODE XREF: sub_441F90+2Ap

var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4
arg_0= dword ptr  4

mov	eax, dword ptr dword_81C1528
sub	esp, 0Ch
xor	ecx, ecx
push	ebx
push	ebp
push	esi
mov	esi, [esp+18h+arg_0]
cmp	eax, ecx
push	edi
mov	ebx, 3F800000h
jnz	short loc_441352
mov	ax, [esi+2]
cmp	ax, 7Dh
jz	short loc_44133B
cmp	ax, 7Eh
jnz	short loc_44139A

loc_44133B:				; CODE XREF: sub_441310+23j
cmp	dword ptr dword_7C41878, 4
jnz	short loc_44134C
mov	[esi+154h], ecx
jmp	short loc_441352
; ---------------------------------------------------------------------------

loc_44134C:				; CODE XREF: sub_441310+32j
mov	[esi+154h], ebx

loc_441352:				; CODE XREF: sub_441310+19j
					; sub_441310+3Aj
cmp	dword ptr dword_81C1528, 2
jnz	short loc_44139A
mov	ax, [esi+2]
cmp	ax, 51h
jz	short loc_44137D
cmp	ax, 52h
jz	short loc_44137D
cmp	ax, 60h
jz	short loc_44137D
cmp	ax, 62h
jz	short loc_44137D
cmp	ax, 63h
jnz	short loc_44139A

loc_44137D:				; CODE XREF: sub_441310+53j
					; sub_441310+59j ...
mov	eax, dword ptr dword_7C41878
cmp	eax, 3
jz	short loc_441394
cmp	eax, 0Ah
jge	short loc_441394
mov	[esi+154h], ebx
jmp	short loc_44139A
; ---------------------------------------------------------------------------

loc_441394:				; CODE XREF: sub_441310+75j
					; sub_441310+7Aj
mov	[esi+154h], ecx

loc_44139A:				; CODE XREF: sub_441310+29j
					; sub_441310+49j ...
push	esi
call	sub_40D9B0
fld	dword ptr [esi+158h]
fcomp	dword ptr flt_478754
add	esp, 4
fnstsw	ax
test	ah, 1
jnz	loc_441D90			; jumptable 004414AF default case
movsx	eax, word ptr [esi+2]
mov	dl, [esi+0F5h]
lea	ebp, [esi+18h]
lea	ecx, [eax+eax*2]
lea	edi, [esi+0Ch]
shl	ecx, 3
sub	ecx, eax
push	ebp				; int
push	edi				; int
lea	ecx, byte_5729398[ecx*8]
mov	[ecx+0A0h], dl
mov	eax, [esi+0BCh]
lea	edx, [esi+0F6h]
push	eax				; float
push	edx				; int
lea	eax, [esi+0FCh]
lea	edx, [esi+0F8h]
push	eax				; int
push	edx				; int
call	sub_40FFA0
mov	eax, dword ptr nScene_482904
cmp	eax, 2
jz	short loc_441415
cmp	eax, 4
jnz	loc_44149F

loc_441415:				; CODE XREF: sub_441310+FAj
movsx	eax, word ptr [esi+2]
sub	eax, 0A0h
jz	short loc_441479
dec	eax
jz	short loc_44145C
dec	eax
jnz	short loc_44149F
mov	eax, dword ptr dword_81C4974
xor	edx, edx
cmp	eax, edx
jnz	short loc_44143F
fild	dword ptr dword_482928
fmul	dword ptr flt_4787E8
jmp	short loc_441445
; ---------------------------------------------------------------------------

loc_44143F:				; CODE XREF: sub_441310+11Fj
fld	dword ptr flt_478794

loc_441445:				; CODE XREF: sub_441310+12Dj
fst	dword ptr [esi+0D8h]
fst	dword ptr [esi+0DCh]
fst	dword ptr [esi+0E0h]
fstp	dword ptr [esi+64h]
jmp	short loc_4414A1
; ---------------------------------------------------------------------------

loc_44145C:				; CODE XREF: sub_441310+111j
fld	dword ptr flt_5727448
call	__ftol
cdq
mov	ecx, 0FA0h
idiv	ecx
mov	[esp+1Ch+arg_0], edx
fild	[esp+1Ch+arg_0]
jmp	short loc_441494
; ---------------------------------------------------------------------------

loc_441479:				; CODE XREF: sub_441310+10Ej
fld	dword ptr flt_5727448
call	__ftol
cdq
mov	ecx, 0FA0h
idiv	ecx
mov	[esp+1Ch+arg_0], edx
fild	[esp+1Ch+arg_0]

loc_441494:				; CODE XREF: sub_441310+167j
fmul	dword ptr flt_478A30
fchs
fstp	dword ptr [esi+6Ch]

loc_44149F:				; CODE XREF: sub_441310+FFj
					; sub_441310+114j
xor	edx, edx

loc_4414A1:				; CODE XREF: sub_441310+14Aj
mov	eax, dword ptr dword_81C1528
cmp	eax, 7				; switch 8 cases
ja	loc_441D90			; jumptable 004414AF default case
jmp	ds:off_441D98[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_4414B6:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 0
add	eax, 0FFFFFFCEh			; switch 101 cases
cmp	eax, 64h
ja	loc_441D90			; jumptable 004414AF default case
xor	edx, edx
mov	dl, ds:byte_441DF0[eax]
jmp	ds:off_441DB8[edx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_4414D5:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
fld	dword ptr flt_5727448			; jumptable 004414CE cases 118,119
call	__ftol
neg	eax
cdq
mov	ecx, 3E8h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478894
fstp	dword ptr [esi+6Ch]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441503:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
call	_rand				; jumptable 004414CE cases 117,122
and	eax, 80000003h
jns	short loc_441514
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_441514:				; CODE XREF: sub_441310+1FDj
add	eax, 4
pop	edi
mov	[esp+18h+arg_0], eax
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+64h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441530:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	0				; jumptable 004414CE case 130
push	0
push	0
push	esi
push	0
call	sub_41BEE0
add	esp, 14h
mov	dword ptr [esi+54h], 0FFFFFFFEh
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441550:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	0				; jumptable 004414CE case 131
push	0
push	0
push	esi
push	1
call	sub_41BEE0
add	esp, 14h
mov	dword ptr [esi+54h], 0FFFFFFFEh
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441570:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	0				; jumptable 004414CE case 132
push	0
push	0
push	esi
push	2
call	sub_41BEE0
add	esp, 14h
mov	dword ptr [esi+54h], 0FFFFFFFEh
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441590:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	41F00000h			; jumptable 004414CE case 80
push	0C3480000h
push	42B40000h
push	esi
push	0
call	sub_41BEE0
push	41F00000h
push	43480000h
push	42B40000h
push	esi
push	0
call	sub_41BEE0
add	esp, 28h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_4415C9:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	430C0000h			; jumptable 004414CE case 55
push	0C3160000h
push	0C3160000h
push	esi
push	0
call	sub_41BEE0
push	430C0000h
push	0C3160000h
push	43160000h
push	esi
push	0
call	sub_41BEE0
add	esp, 28h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441602:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	43480000h			; jumptable 004414CE case 50
push	0
push	0
push	esi
push	0
call	sub_41BEE0
add	esp, 14h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_44161E:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	42700000h			; jumptable 004414CE case 51
jmp	loc_4417BE
; ---------------------------------------------------------------------------

loc_441628:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
call	_rand				; jumptable 004414CE case 90
and	eax, 80000001h
jns	short loc_441639
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_441639:				; CODE XREF: sub_441310+322j
add	eax, 6
mov	ecx, [edi]
mov	[esp+1Ch+arg_0], eax
mov	eax, [esi+10h]
fild	[esp+1Ch+arg_0]
push	offset dword_7FE9D40		; int
lea	edx, [esp+20h+var_C]
push	3				; int
push	edx				; int
fmul	dword ptr flt_478700
push	eax				; float
push	ecx				; float
fst	[esp+30h+var_C]
fld	st
fmul	dword ptr flt_478750
fstp	[esp+30h+var_8]
fmul	dword ptr flt_4787DC
fstp	[esp+30h+var_4]
call	sub_43CA40
add	esp, 14h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441687:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
push	42700000h			; jumptable 004414CE case 52
push	0
push	0
push	esi
push	0
call	sub_41BEE0
add	esp, 14h
call	_rand
cdq
mov	ecx, 6
pop	edi
idiv	ecx
add	edx, 4
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+64h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_4416C4:				; CODE XREF: sub_441310+1BEj
					; DATA XREF: .text:off_441DB8o
call	_rand				; jumptable 004414CE case 150
and	eax, 80000003h
jns	short loc_4416D5
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_4416D5:				; CODE XREF: sub_441310+3BEj
add	eax, 3
mov	ecx, [edi]
mov	[esp+1Ch+arg_0], eax
mov	eax, [esi+10h]
fild	[esp+1Ch+arg_0]
push	offset dword_7FE9D40		; int
lea	edx, [esp+20h+var_C]
push	3				; int
push	edx				; int
fmul	dword ptr flt_478700
push	eax				; float
push	ecx				; float
fst	[esp+30h+var_C]
fld	st
fmul	dword ptr flt_4787DC
fstp	[esp+30h+var_8]
fmul	dword ptr flt_47870C
fstp	[esp+30h+var_4]
call	sub_43CA40
add	esp, 14h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441723:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 1
lea	ecx, [eax-16h]			; switch 31 cases
cmp	ecx, 1Eh
ja	loc_441D90			; jumptable 004414AF default case
xor	edx, edx
mov	dl, ds:byte_441E70[ecx]
jmp	ds:off_441E58[edx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_441742:				; CODE XREF: sub_441310+42Bj
					; DATA XREF: .text:off_441E58o
call	_rand				; jumptable 0044173B case 52
cdq
mov	ecx, 3
idiv	ecx
test	edx, edx
jnz	short loc_44176E
push	edx
push	0FFFFFFFFh
push	edx
push	edx
lea	edx, [esi+0D8h]
push	edx
push	ebp
push	edi
push	0D7h
call	sub_41E430
add	esp, 20h

loc_44176E:				; CODE XREF: sub_441310+441j
mov	dword ptr [esi+54h], 0FFFFFFFEh
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_44177D:				; CODE XREF: sub_441310+42Bj
					; DATA XREF: .text:off_441E58o
fld	dword ptr flt_5727448			; jumptable 0044173B cases 22-24
lea	ecx, [eax+eax*2]
shl	ecx, 3
sub	ecx, eax
mov	byte ptr byte_5729420[ecx*8], 1
call	__ftol
cdq
mov	ecx, 3E8h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_4787C8
fstp	dword ptr [esi+6Ch]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_4417B9:				; CODE XREF: sub_441310+42Bj
					; DATA XREF: .text:off_441E58o
push	43700000h			; jumptable 0044173B case 41

loc_4417BE:				; CODE XREF: sub_441310+313j
push	0C1F00000h
push	0
push	esi
push	0
call	sub_41BEE0
add	esp, 14h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_4417D8:				; CODE XREF: sub_441310+42Bj
					; DATA XREF: .text:off_441E58o
push	433E0000h			; jumptable 0044173B case 42
push	0
push	0
push	esi
push	0
call	sub_41BEE0
add	esp, 14h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_4417F4:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
mov	cx, [esi+2]			; jumptable 004414AF case 2
movsx	eax, cx
add	eax, 0FFFFFFECh			; switch 69 cases
cmp	eax, 44h
ja	loc_441D90			; jumptable 004414AF default case
xor	ebx, ebx
mov	bl, ds:byte_441EA0[eax]
jmp	ds:off_441E90[ebx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_441816:				; CODE XREF: sub_441310+4FFj
					; DATA XREF: .text:off_441E90o
call	_rand				; jumptable 0044180F case 78
and	eax, 80000003h
jns	short loc_441827
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_441827:				; CODE XREF: sub_441310+510j
add	eax, 4
pop	edi
mov	[esp+18h+arg_0], eax
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+64h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441843:				; CODE XREF: sub_441310+4FFj
					; DATA XREF: .text:off_441E90o
push	42480000h			; jumptable 0044180F cases 30,66
push	0
push	0
push	esi
push	0
call	sub_41BEE0
add	esp, 14h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_44185F:				; CODE XREF: sub_441310+4FFj
					; DATA XREF: .text:off_441E90o
cmp	dword ptr dword_7C41CC0, edx		; jumptable 0044180F cases 20,65,86,88
jnz	loc_441D90			; jumptable 004414AF default case
mov	eax, dword ptr dword_79DBE88
fld	dword ptr [eax+0Ch]
fsub	dword ptr [esi+30h]
fld	dword ptr [eax+10h]
fsub	dword ptr [esi+34h]
fld	st
fmul	st, st(1)
fld	st(2)
fmul	st, st(3)
faddp	st(1), st
fsqrt
fstp	st(2)
fstp	st
fst	[esp+1Ch+arg_0]
fcomp	dword ptr flt_478854
fnstsw	ax
test	ah, 1
jz	loc_4419D7
cmp	cx, 56h
jnz	loc_441932
cmp	dword ptr [esi+20h], 42B40000h
jnz	short loc_4418C6
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fadd	st, st
fadd	dword ptr [esi+34h]
fstp	dword ptr [esi+10h]

loc_4418C6:				; CODE XREF: sub_441310+5A2j
cmp	dword ptr [esi+20h], 43870000h
jnz	short loc_4418E1
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fadd	st, st
fsubr	dword ptr [esi+34h]
fstp	dword ptr [esi+10h]

loc_4418E1:				; CODE XREF: sub_441310+5BDj
fld	dword ptr [esi+20h]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 40h
jz	short loc_441902
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fadd	st, st
fadd	dword ptr [esi+30h]
fstp	dword ptr [edi]

loc_441902:				; CODE XREF: sub_441310+5DFj
cmp	dword ptr [esi+20h], 43340000h
jnz	short loc_44191C
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fadd	st, st
fsubr	dword ptr [esi+30h]
fstp	dword ptr [edi]

loc_44191C:				; CODE XREF: sub_441310+5F9j
push	0
push	0
push	12h
call	sub_401570
add	esp, 0Ch
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441932:				; CODE XREF: sub_441310+595j
cmp	dword ptr [esi+2Ch], 42B40000h
jnz	short loc_441954
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fmul	dword ptr flt_4786E0
fsubr	dword ptr flt_4787A4
fstp	dword ptr [esi+20h]

loc_441954:				; CODE XREF: sub_441310+629j
cmp	dword ptr [esi+2Ch], 43870000h
jnz	short loc_441976
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fmul	dword ptr flt_4786E0
fadd	dword ptr flt_478A2C
fstp	dword ptr [esi+20h]

loc_441976:				; CODE XREF: sub_441310+64Bj
fld	dword ptr [esi+2Ch]
fcomp	dword ptr flt_4786F4
fnstsw	ax
test	ah, 40h
jz	short loc_44199F
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fmul	dword ptr flt_4786E0
fsubr	dword ptr flt_478984
fstp	dword ptr [esi+20h]

loc_44199F:				; CODE XREF: sub_441310+674j
cmp	dword ptr [esi+2Ch], 43340000h
jnz	short loc_4419C1
fld	dword ptr flt_478854
fsub	[esp+1Ch+arg_0]
fmul	dword ptr flt_4786E0
fadd	dword ptr flt_478A28
fstp	dword ptr [esi+20h]

loc_4419C1:				; CODE XREF: sub_441310+696j
push	0
push	0
push	11h
call	sub_401570
add	esp, 0Ch
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_4419D7:				; CODE XREF: sub_441310+58Bj
mov	edx, [esi+2Ch]
mov	eax, [esi+20h]
push	41200000h			; float
push	edx				; float
push	eax				; float
call	sub_40D5A0
fstp	dword ptr [esi+20h]
fld	dword ptr [esi+30h]
fsub	dword ptr [edi]
add	esp, 0Ch
fmul	dword ptr flt_47870C
fadd	dword ptr [edi]
fstp	dword ptr [edi]
fld	dword ptr [esi+34h]
fsub	dword ptr [esi+10h]
pop	edi
fmul	dword ptr flt_47870C
fadd	dword ptr [esi+10h]
fstp	dword ptr [esi+10h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441A18:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 3
lea	ecx, [eax-12h]			; switch 26 cases
cmp	ecx, 19h
ja	loc_441D90			; jumptable 004414AF default case
xor	edx, edx
mov	dl, ds:byte_441F00[ecx]
jmp	ds:off_441EE8[edx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_441A37:				; CODE XREF: sub_441310+720j
					; DATA XREF: .text:off_441EE8o
fld	dword ptr flt_5727448			; jumptable 00441A30 case 18
call	__ftol
cdq
mov	ecx, 3E8h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478894
fstp	dword ptr [esi+6Ch]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441A63:				; CODE XREF: sub_441310+720j
					; DATA XREF: .text:off_441EE8o
mov	dword ptr [esi+60h], 0		; jumptable 00441A30 case 41
fld	dword ptr flt_5727448
call	__ftol
cdq
mov	ecx, 7D0h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478A24
fstp	dword ptr [esi+6Ch]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441A96:				; CODE XREF: sub_441310+720j
					; DATA XREF: .text:off_441EE8o
fld	dword ptr flt_5727448			; jumptable 00441A30 case 42
lea	edx, [eax+eax*2]
shl	edx, 3
sub	edx, eax
mov	byte ptr byte_5729420[edx*8], 0
call	__ftol
cdq
mov	ecx, 1F4h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478A20
fstp	dword ptr [esi+68h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441AD2:				; CODE XREF: sub_441310+720j
					; DATA XREF: .text:off_441EE8o
fld	dword ptr flt_5727448			; jumptable 00441A30 case 43
lea	edx, [eax+eax*2]
shl	edx, 3
sub	edx, eax
mov	byte ptr byte_5729420[edx*8], 0
call	__ftol
cdq
mov	ecx, 1F4h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_4787E8
fstp	dword ptr [esi+68h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441B0E:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 4
add	eax, 0FFFFFFFDh			; switch 37 cases
cmp	eax, 24h
ja	loc_441D90			; jumptable 004414AF default case
xor	edx, edx
mov	dl, ds:byte_441F38[eax]
jmp	ds:off_441F1C[edx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_441B2D:				; CODE XREF: sub_441310+816j
					; DATA XREF: .text:off_441F1Co
push	esi				; jumptable 00441B26 cases 38,39
call	sub_41C0F0
add	esp, 4
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441B3E:				; CODE XREF: sub_441310+816j
					; DATA XREF: .text:off_441F1Co
fld	dword ptr flt_5727448			; jumptable 00441B26 cases 3,4
call	__ftol
neg	eax
cdq
mov	ecx, 3E8h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478894
fstp	dword ptr [esi+68h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441B6C:				; CODE XREF: sub_441310+816j
					; DATA XREF: .text:off_441F1Co
mov	dword ptr [esi+60h], 4		; jumptable 00441B26 cases 19,20
fld	dword ptr flt_5727448
call	__ftol
neg	eax
cdq
mov	ecx, 3E8h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478894
fstp	dword ptr [esi+68h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441BA1:				; CODE XREF: sub_441310+720j
					; sub_441310+816j
					; DATA XREF: ...
mov	dword ptr [esi+60h], 1		; jumptable 00441A30 case 39
					; jumptable 00441B26 cases 18,23
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441BB0:				; CODE XREF: sub_441310+816j
					; DATA XREF: .text:off_441F1Co
mov	dword ptr [esi+54h], 0FFFFFFFEh	; jumptable 00441B26 case 24
call	_rand
and	eax, 8000003Fh
jns	short loc_441BC8
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_441BC8:				; CODE XREF: sub_441310+8B1j
jnz	loc_441D90			; jumptable 004414AF default case
push	0
push	0FFFFFFFFh
push	0
add	esi, 0D8h
push	0
push	esi
push	ebp
push	edi
push	47Eh
call	sub_41E430
add	esp, 20h
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441BF4:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 5
sub	eax, 2
jz	short loc_441C38		; jumptable 00441CB1 case 38
dec	eax
jnz	loc_441D90			; jumptable 004414AF default case
mov	dword ptr [esi+60h], 0
call	_rand
and	eax, 80000003h
jns	short loc_441C1C
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_441C1C:				; CODE XREF: sub_441310+905j
add	eax, 6
pop	edi
mov	[esp+18h+arg_0], eax
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+64h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441C38:				; CODE XREF: sub_441310+8EBj
					; sub_441310+9A1j
					; DATA XREF: ...
mov	[esi+60h], edx			; jumptable 00441CB1 case 38
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441C43:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 6
cmp	eax, 15h
jz	short loc_441C64
cmp	eax, 26h
jnz	loc_441D90			; jumptable 004414AF default case

loc_441C55:				; CODE XREF: sub_441310+42Bj
					; sub_441310+816j
					; DATA XREF: ...
mov	dword ptr [esi+54h], 0FFFFFFFEh	; jumptable 0044173B cases 39,40,51
					; jumptable 00441B26 case 25
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441C64:				; CODE XREF: sub_441310+93Aj
mov	dword ptr [esi+60h], 3
fld	dword ptr flt_5727448
call	__ftol
neg	eax
cdq
mov	ecx, 3E8h
pop	edi
idiv	ecx
mov	[esp+18h+arg_0], edx
fild	[esp+18h+arg_0]
fmul	dword ptr flt_478894
fstp	dword ptr [esi+6Ch]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441C99:				; CODE XREF: sub_441310+19Fj
					; DATA XREF: .text:off_441D98o
movsx	eax, word ptr [esi+2]		; jumptable 004414AF case 7
add	eax, 0FFFFFFEAh			; switch 19 cases
cmp	eax, 12h
ja	loc_441D90			; jumptable 004414AF default case
xor	ecx, ecx
mov	cl, ds:byte_441F78[eax]
jmp	ds:off_441F60[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_441CB8:				; CODE XREF: sub_441310+9A1j
					; DATA XREF: .text:off_441F60o
fld	dword ptr [esi+74h]		; jumptable 00441CB1 case 22
fadd	dword ptr flt_478700
mov	dword ptr [esi+54h], 0FFFFFFFEh
fst	dword ptr [esi+74h]
fcomp	dword ptr flt_478788
fnstsw	ax
test	ah, 41h
jnz	short loc_441CDB
mov	[esi+74h], edx

loc_441CDB:				; CODE XREF: sub_441310+9C6j
fld	dword ptr [esi+74h]
fcomp	dword ptr flt_478764
fnstsw	ax
test	ah, 41h
jnz	loc_441D90			; jumptable 004414AF default case
push	0
push	ebx
add	esi, 0D8h
push	0
push	esi
push	ebp
push	edi
push	4A7h
call	sub_4212F0
add	esp, 1Ch
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441D12:				; CODE XREF: sub_441310+9A1j
					; DATA XREF: .text:off_441F60o
mov	[esi+60h], edx			; jumptable 00441CB1 case 23
pop	edi
fld	dword ptr flt_5727448
fmul	dword ptr flt_4787E8
fsin
fmul	dword ptr flt_478758
fadd	dword ptr flt_4786E0
fstp	dword ptr [esi+64h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441D3A:				; CODE XREF: sub_441310+9A1j
					; DATA XREF: .text:off_441F60o
mov	dword ptr [esi+60h], 1		; jumptable 00441CB1 cases 32,34
pop	edi
fld	dword ptr flt_5727448
fmul	dword ptr flt_4786B0
fsin
fadd	dword ptr flt_4786B8
fmul	dword ptr flt_4786E0
fstp	dword ptr [esi+64h]
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
; ---------------------------------------------------------------------------

loc_441D66:				; CODE XREF: sub_441310+9A1j
					; DATA XREF: .text:off_441F60o
mov	[esi+60h], edx			; jumptable 00441CB1 case 40
fld	dword ptr flt_5727448
fmul	dword ptr flt_4786B0
mov	dword ptr [esi+0BCh], 3D4CCCCDh
fsin
fmul	dword ptr flt_478758
fadd	dword ptr flt_4786E0
fstp	dword ptr [esi+64h]

loc_441D90:				; CODE XREF: sub_441310+A4j
					; sub_441310+199j ...
pop	edi				; jumptable 004414AF default case
pop	esi
pop	ebp
pop	ebx
add	esp, 0Ch
retn
align 4
; ---------------------------------------------------------------------------
off_441D98 dd offset loc_4414B6		; DATA XREF: sub_441310+19Fr
dd offset loc_441723			; jump table for switch	statement
dd offset loc_4417F4
dd offset loc_441A18
dd offset loc_441B0E
dd offset loc_441BF4
dd offset loc_441C43
dd offset loc_441C99
off_441DB8 dd offset loc_441602, offset	loc_44161E, offset loc_441687, offset loc_4415C9
					; DATA XREF: sub_441310+1BEr
dd offset loc_441590, offset loc_441628, offset	loc_441D90, offset loc_441503 ;	jump table for switch statement
dd offset loc_4414D5, offset loc_441530, offset	loc_441550, offset loc_441570
dd offset loc_4416C4, offset loc_441D90
byte_441DF0 db	    0,	   1,	  2,   0Dh ; DATA XREF:	sub_441310+1B8r
db    0Dh,     3,   0Dh,   0Dh		; indirect table for switch statement
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,     4,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db	5,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,     6
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,     7
db	8,     8,   0Dh,   0Dh
db	7,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db	9,   0Ah,   0Bh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Dh,   0Dh,   0Dh,   0Dh
db    0Ch
align 4
off_441E58 dd offset loc_44177D		; DATA XREF: sub_441310+42Br
dd offset loc_441C55			; jump table for switch	statement
dd offset loc_4417B9
dd offset loc_4417D8
dd offset loc_441742
dd offset loc_441D90
byte_441E70 db	    0,	   0,	  0,	 5 ; DATA XREF:	sub_441310+425r
db	5,     5,     5,     5		; indirect table for switch statement
db	5,     5,     5,     5
db	5,     5,     5,     5
db	5,     1,     1,     2
db	3,     5,     5,     5
db	5,     5,     5,     5
db	5,     1,     4
align 10h
off_441E90 dd offset loc_44185F, offset	loc_441843, offset loc_441816, offset loc_441D90
					; DATA XREF: sub_441310+4FFr
					; jump table for switch	statement
byte_441EA0 db	    0,	   3,	  3,	 3 ; DATA XREF:	sub_441310+4F9r
db	3,     3,     3,     3		; indirect table for switch statement
db	3,     3,     1,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     0,     1,     3
db	3,     3,     3,     3
db	3,     3,     3,     3
db	3,     3,     2,     3
db	3,     3,     3,     3
db	3,     3,     0,     3
db	0
align 4
off_441EE8 dd offset loc_441A37		; DATA XREF: sub_441310+720r
dd offset loc_441BA1			; jump table for switch	statement
dd offset loc_441A63
dd offset loc_441A96
dd offset loc_441AD2
dd offset loc_441D90
byte_441F00 db	    0,	   5,	  5,	 5 ; DATA XREF:	sub_441310+71Ar
db	5,     5,     5,     5		; indirect table for switch statement
db	5,     5,     5,     5
db	5,     5,     5,     5
db	5,     5,     5,     5
db	5,     1,     5,     2
db	3,     4
align 4
off_441F1C dd offset loc_441B3E		; DATA XREF: sub_441310+816r
dd offset loc_441BA1			; jump table for switch	statement
dd offset loc_441B6C
dd offset loc_441BB0
dd offset loc_441C55
dd offset loc_441B2D
dd offset loc_441D90
byte_441F38 db	    0,	   0,	  6,	 6 ; DATA XREF:	sub_441310+810r
db	6,     6,     6,     6		; indirect table for switch statement
db	6,     6,     6,     6
db	6,     6,     6,     1
db	2,     2,     6,     6
db	1,     3,     4,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     5
db	5
align 10h
off_441F60 dd offset loc_441CB8		; DATA XREF: sub_441310+9A1r
dd offset loc_441D12			; jump table for switch	statement
dd offset loc_441D3A
dd offset loc_441C38
dd offset loc_441D66
dd offset loc_441D90
byte_441F78 db	    0,	   1,	  5,	 5 ; DATA XREF:	sub_441310+99Br
db	5,     5,     5,     5		; indirect table for switch statement
db	5,     5,     2,     5
db	2,     5,     5,     5
db	3,     5,     4
sub_441310 endp

align 10h

; =============== S U B	R O U T	I N E =======================================


sub_441F90 proc	near			; CODE XREF: sub_452000+515p
					; sub_453370+278p ...
push	ebx
push	ebp
push	esi
push	edi
mov	eax, offset dword_81BDE6C
xor	ebx, ebx

loc_441F9B:				; CODE XREF: sub_441F90+66j
mov	edi, eax
mov	ebp, 10h

loc_441FA2:				; CODE XREF: sub_441F90+5Cj
cmp	[edi+8], bl
jz	short loc_441FCE
mov	esi, [edi]

loc_441FA9:				; CODE XREF: sub_441F90+3Cj
cmp	esi, ebx
jz	short loc_441FE8
cmp	[esi], bl
jz	short loc_441FC2
cmp	[esi+150h], bl
jz	short loc_441FC2
push	esi
call	sub_441310
add	esp, 4

loc_441FC2:				; CODE XREF: sub_441F90+1Fj
					; sub_441F90+27j
mov	esi, [esi+174h]
cmp	esi, ebx
jz	short loc_441FE8
jmp	short loc_441FA9
; ---------------------------------------------------------------------------

loc_441FCE:				; CODE XREF: sub_441F90+15j
mov	eax, [edi]

loc_441FD0:				; CODE XREF: sub_441F90+56j
cmp	eax, ebx
jz	short loc_441FE8
mov	ecx, [eax+174h]
mov	[eax+150h], bl
cmp	ecx, ebx
jz	short loc_441FE8
mov	eax, ecx
jmp	short loc_441FD0
; ---------------------------------------------------------------------------

loc_441FE8:				; CODE XREF: sub_441F90+1Bj
					; sub_441F90+3Aj ...
add	edi, 10h
dec	ebp
jnz	short loc_441FA2
cmp	edi, offset byte_81BEE6C
mov	eax, edi
jl	short loc_441F9B
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_441F90 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_442000 proc	near			; CODE XREF: sub_442020+3BBp
					; sub_442020+462p ...

arg_0= dword ptr  4

mov	eax, offset byte_81BFD18

loc_442005:				; CODE XREF: sub_442000+12j
cmp	byte ptr [eax],	0
jz	short loc_442015
add	eax, 0Ch
cmp	eax, offset byte_81C0678
jl	short loc_442005
retn
; ---------------------------------------------------------------------------

loc_442015:				; CODE XREF: sub_442000+8j
mov	ecx, [esp+arg_0]
mov	byte ptr [eax],	1
mov	[eax+8], ecx
retn
sub_442000 endp


; =============== S U B	R O U T	I N E =======================================


sub_442020 proc	near			; CODE XREF: sub_430580+163p
					; sub_430580+215p ...

var_4= dword ptr -4
arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

push	ecx
push	ebx
push	esi
mov	esi, [esp+0Ch+arg_4]
fld	dword ptr [esi]
fmul	dword ptr flt_478A34
call	__ftol
fld	dword ptr [esi+4]
fmul	dword ptr flt_478A34
mov	[esp+0Ch+var_4], eax
call	__ftol
mov	ecx, [esp+0Ch+var_4]
xor	ebx, ebx
cmp	ecx, ebx
jl	loc_4424C5
cmp	eax, ebx
jl	loc_4424C5
cmp	ecx, 10h
jge	loc_4424C5
cmp	eax, 10h
jge	loc_4424C5
shl	cl, 4
add	cl, al
push	ebp
mov	byte ptr [esp+10h+var_4], cl
push	edi
mov	ebp, [esp+14h+var_4]
push	178h				; unsigned int
and	ebp, 0FFh
shl	ebp, 4
add	ebp, offset byte_81BDE68
call	new_mem_byte			; operator new(uint)
mov	esi, eax
mov	ecx, 5Eh
xor	eax, eax
mov	edi, esi
rep stosd
mov	eax, [ebp+4]
add	esp, 4
cmp	eax, ebx
jnz	short loc_4420BE
mov	[esi+170h], ebx
mov	[esi+174h], ebx
mov	[ebp+4], esi
jmp	short loc_4420D6
; ---------------------------------------------------------------------------

loc_4420BE:				; CODE XREF: sub_442020+8Bj
mov	eax, [ebp+8]
mov	[eax+174h], esi
mov	ecx, [ebp+8]
mov	[esi+170h], ecx
mov	[esi+174h], ebx

loc_4420D6:				; CODE XREF: sub_442020+9Cj
mov	eax, [esp+14h+arg_C]
mov	edx, 1
mov	[ebp+8], esi
mov	ebp, [esp+14h+arg_0]
mov	[esi], dl
mov	[esi+150h], bl
mov	[esi+151h], bl
mov	[esi+0CCh], dl
mov	[esi+0D4h], bl
mov	[esi+100h], bl
mov	[esi+2], bp
mov	ecx, 3F800000h
mov	[esi+8], eax
mov	al, byte ptr [esp+14h+var_4]
mov	[esi+158h], ecx
mov	[esi+154h], ecx
mov	dword ptr [esi+0BCh], 3E23D70Ah
or	edi, 0FFFFFFFFh
mov	dword ptr [esi+0C4h], 42480000h
mov	[esi+54h], edi
mov	[esi+0F5h], bl
mov	[esi+0F6h], bl
mov	[esi+0F8h], ebx
mov	[esi+0FCh], ebx
mov	[esi+16Ch], al
mov	eax, [esp+14h+arg_4]
mov	[esi+60h], edi
mov	[esi+64h], ecx
mov	[esi+68h], ebx
mov	[esi+6Ch], ebx
mov	[esi+71h], bl
mov	dword ptr [esi+0C0h], 0C1F00000h
mov	[esi+74h], ebx
mov	edi, [eax]
mov	[esi+0Ch], edi
mov	edi, [eax+4]
mov	[esi+10h], edi
mov	eax, [eax+8]
mov	[esi+14h], eax
mov	eax, [esp+14h+arg_8]
mov	edi, [eax]
mov	[esi+18h], edi
mov	edi, [eax+4]
mov	[esi+1Ch], edi
mov	eax, [eax+8]
mov	[esi+20h], eax
mov	eax, 0C2200000h
mov	[esi+108h], eax
mov	[esi+10Ch], eax
mov	eax, 42200000h
mov	[esi+0D8h], ebx
mov	[esi+0DCh], ebx
mov	[esi+0E0h], ebx
mov	[esi+24h], ebx
mov	[esi+28h], ebx
mov	[esi+2Ch], ebx
mov	[esi+0B0h], ebx
mov	[esi+0B4h], ebx
mov	[esi+0B8h], ebx
mov	[esi+110h], ebx
mov	[esi+114h], eax
mov	[esi+118h], eax
mov	dword ptr [esi+11Ch], 42A00000h
mov	eax, dword ptr nScene_482904
cmp	eax, 2
jz	short loc_442212
cmp	eax, 4
jnz	loc_4422DA			; jumptable 00442226 default case

loc_442212:				; CODE XREF: sub_442020+1E7j
lea	edi, [ebp-3Ch]			; switch 105 cases
cmp	edi, 68h
ja	loc_4422DA			; jumptable 00442226 default case
xor	eax, eax
mov	al, ds:byte_4424E8[edi]
jmp	ds:off_4424CC[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_44222D:				; CODE XREF: sub_442020+206j
					; DATA XREF: .text:off_4424CCo
mov	eax, 3E4CCCCDh			; jumptable 00442226 case 60
mov	dword ptr [esi+8], 3F4CCCCDh
mov	[esi+0D8h], eax
mov	[esi+0DCh], eax
mov	[esi+0E0h], eax
mov	[esi+0CCh], dl
jmp	loc_4422DA			; jumptable 00442226 default case
; ---------------------------------------------------------------------------

loc_442256:				; CODE XREF: sub_442020+206j
					; DATA XREF: .text:off_4424CCo
mov	dword ptr [esi+8], 3F4CCCCDh	; jumptable 00442226 case 161
mov	[esi+60h], ebx
mov	[esi+64h], ecx
jmp	short loc_4422C8
; ---------------------------------------------------------------------------

loc_442265:				; CODE XREF: sub_442020+206j
					; DATA XREF: .text:off_4424CCo
mov	dword ptr [esi+8], 3F19999Ah	; jumptable 00442226 case 162
mov	[esi+60h], edx
mov	[esi+0CCh], bl
jmp	short loc_4422DA		; jumptable 00442226 default case
; ---------------------------------------------------------------------------

loc_442277:				; CODE XREF: sub_442020+206j
					; DATA XREF: .text:off_4424CCo
mov	dword ptr [esi+8], 3D343958h	; jumptable 00442226 case 160
mov	[esi+60h], edx
mov	[esi+64h], ecx
mov	[esi+0D8h], ecx
mov	[esi+0DCh], ecx
mov	[esi+0E0h], ecx
mov	[esi+0CCh], bl
jmp	short loc_4422DA		; jumptable 00442226 default case
; ---------------------------------------------------------------------------

loc_44229E:				; CODE XREF: sub_442020+206j
					; DATA XREF: .text:off_4424CCo
mov	eax, 3F000000h			; jumptable 00442226 case 163
mov	dword ptr [esi+8], 40400000h
mov	[esi+60h], ebx
mov	[esi+0D8h], eax
mov	[esi+0DCh], eax
mov	[esi+0E0h], eax
jmp	short loc_4422DA		; jumptable 00442226 default case
; ---------------------------------------------------------------------------

loc_4422C1:				; CODE XREF: sub_442020+206j
					; DATA XREF: .text:off_4424CCo
mov	dword ptr [esi+60h], 0Ah	; jumptable 00442226 case 164

loc_4422C8:				; CODE XREF: sub_442020+243j
mov	[esi+0D8h], ecx
mov	[esi+0DCh], ecx
mov	[esi+0E0h], ecx

loc_4422DA:				; CODE XREF: sub_442020+1ECj
					; sub_442020+1F8j ...
mov	eax, dword ptr dword_81C1528		; jumptable 00442226 default case
cmp	eax, 7				; switch 8 cases
ja	loc_4424BD			; jumptable 004422E8 default case
jmp	ds:off_442554[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_4422EF:				; CODE XREF: sub_442020+2C8j
					; DATA XREF: .text:off_442554o
cmp	ebp, 96h			; jumptable 004422E8 case 0
ja	loc_4424BD			; jumptable 004422E8 default case
xor	ecx, ecx
mov	cl, ss:byte_4425A8[ebp]
jmp	ds:off_442574[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_44230A:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
pop	edi				; jumptable 00442303 case 80
mov	dword ptr [esi+0C0h], 0C2480000h
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_44231C:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
pop	edi				; jumptable 00442303 cases 117,122
mov	dword ptr [esi+60h], 4
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_44232B:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
pop	edi				; jumptable 00442303 case 118
mov	dword ptr [esi+60h], 8
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_44233A:				; CODE XREF: sub_442020+2E3j
					; sub_442020+45Aj
					; DATA XREF: ...
pop	edi				; jumptable 00442303 cases 98,119
					; jumptable 0044247A case 17
mov	dword ptr [esi+60h], 2
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_442349:				; CODE XREF: sub_442020+2E3j
					; sub_442020+401j ...
pop	edi				; jumptable 00442303 case 105
					; jumptable 00442421 case 78
					; jumptable 0044247A case 8
mov	dword ptr [esi+60h], 3
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_442358:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
fld	dword ptr flt_4786B8			; jumptable 00442303 cases 0,1
fdiv	dword ptr [esi+8]
mov	eax, 0C3160000h
pop	edi
mov	[esi+108h], eax
mov	[esi+10Ch], eax
mov	eax, 43160000h
mov	[esi+110h], ebx
mov	[esi+114h], eax
mov	[esi+118h], eax
mov	dword ptr [esi+11Ch], 43FA0000h
mov	eax, esi
pop	ebp
fmul	dword ptr flt_47874C
fstp	dword ptr [esi+0BCh]
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_4423A7:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
mov	[esi+60h], edx			; jumptable 00442303 cases 90,150

loc_4423AA:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
pop	edi				; jumptable 00442303 cases 96,97
mov	dword ptr [esi+0BCh], 3E99999Ah
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_4423BC:				; CODE XREF: sub_442020+2E3j
					; DATA XREF: .text:off_442574o
pop	edi				; jumptable 00442303 case 59
mov	[esi+0BCh], ebx
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_4423CA:				; CODE XREF: sub_442020+2C8j
					; DATA XREF: .text:off_442554o
sub	ebp, 3Bh			; jumptable 004422E8 case 1
jz	loc_442481			; jumptable 00442303 cases 6,145,146
					; jumptable 00442421 cases 22,25,40,45,55,73
					; jumptable 0044247A case 7
dec	ebp
jnz	loc_4424BD			; jumptable 004422E8 default case

loc_4423DA:				; CODE XREF: sub_442020+2E3j
					; sub_442020+401j
					; DATA XREF: ...
push	esi				; jumptable 00442303 case 133
					; jumptable 00442421 case 91
call	sub_442000
add	esp, 4
mov	eax, 42200000h
mov	[esi+114h], eax
mov	[esi+118h], eax
pop	edi
mov	dword ptr [esi+11Ch], 43200000h
mov	dword ptr [esi+54h], 0FFFFFFFEh
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_44240D:				; CODE XREF: sub_442020+2C8j
					; DATA XREF: .text:off_442554o
add	ebp, 0FFFFFFEDh			; jumptable 004422E8 case 2
cmp	ebp, 51h
ja	loc_4424BD			; jumptable 004422E8 default case
xor	eax, eax
mov	al, ss:byte_442660[ebp]
jmp	ds:off_442640[eax*4]		; switch jump
; ---------------------------------------------------------------------------

loc_442428:				; CODE XREF: sub_442020+401j
					; DATA XREF: .text:off_442640o
fld	dword ptr [esi+20h]		; jumptable 00442421 cases 20,65,86,88
call	__ftol
cdq
mov	ecx, 168h
pop	edi
idiv	ecx
mov	eax, [esi+1Ch]
mov	ecx, [esi+0Ch]
mov	[esi+28h], eax
mov	eax, [esi+14h]
mov	[esi+38h], eax
mov	[esi+30h], ecx
mov	eax, esi
pop	ebp
mov	[esp+0Ch+arg_4], edx
mov	edx, [esi+18h]
fild	[esp+0Ch+arg_4]
mov	[esi+24h], edx
mov	edx, [esi+10h]
mov	[esi+34h], edx
fst	dword ptr [esi+20h]
fstp	dword ptr [esi+2Ch]
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_44246C:				; CODE XREF: sub_442020+2C8j
					; DATA XREF: .text:off_442554o
dec	ebp				; jumptable 004422E8 case 3
cmp	ebp, 25h			; switch 38 cases
ja	short loc_4424BD		; jumptable 004422E8 default case
xor	ecx, ecx
mov	cl, ss:byte_4426D0[ebp]
jmp	ds:off_4426B4[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_442481:				; CODE XREF: sub_442020+2E3j
					; sub_442020+3ADj ...
push	esi				; jumptable 00442303 cases 6,145,146
					; jumptable 00442421 cases 22,25,40,45,55,73
					; jumptable 0044247A case 7
call	sub_442000
add	esp, 4
mov	eax, esi
pop	edi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_442492:				; CODE XREF: sub_442020+2E3j
					; sub_442020+401j ...
pop	edi				; jumptable 00442303 case 52
					; jumptable 00442421 cases 54,56
					; jumptable 0044247A case 0
mov	[esi+60h], edx
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_44249D:				; CODE XREF: sub_442020+401j
					; sub_442020+45Aj
					; DATA XREF: ...
pop	edi				; jumptable 00442421 cases 19,92,93
					; jumptable 0044247A cases 16,18,36
mov	[esi+60h], ebx
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_4424A8:				; CODE XREF: sub_442020+2C8j
					; DATA XREF: .text:off_442554o
cmp	ebp, 27h			; jumptable 004422E8 case 7
jnz	short loc_4424BD		; jumptable 004422E8 default case

loc_4424AD:				; CODE XREF: sub_442020+45Aj
					; DATA XREF: .text:off_4426B4o
push	esi				; jumptable 0044247A case 37
call	sub_442000
add	esp, 4

loc_4424B6:				; CODE XREF: sub_442020+401j
					; DATA XREF: .text:off_442640o
mov	dword ptr [esi+54h], 0FFFFFFFEh	; jumptable 00442421 case 100

loc_4424BD:				; CODE XREF: sub_442020+2C2j
					; sub_442020+2C8j ...
pop	edi				; jumptable 004422E8 default case
mov	eax, esi
pop	ebp
pop	esi
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------

loc_4424C5:				; CODE XREF: sub_442020+2Ej
					; sub_442020+36j ...
pop	esi
xor	eax, eax
pop	ebx
pop	ecx
retn
; ---------------------------------------------------------------------------
align 4
off_4424CC dd offset loc_44222D, offset	loc_442277, offset loc_442256, offset loc_442265
					; DATA XREF: sub_442020+206r
dd offset loc_44229E, offset loc_4422C1, offset	loc_4422DA ; jump table	for switch statement
byte_4424E8 db	    0,	   6,	  6,	 6 ; DATA XREF:	sub_442020+200r
db	6,     6,     6,     6		; indirect table for switch statement
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	1,     2,     3,     4
db	5
align 4
off_442554 dd offset loc_4422EF		; DATA XREF: sub_442020+2C8r
dd offset loc_4423CA			; jump table for switch	statement
dd offset loc_44240D
dd offset loc_44246C
dd offset loc_4424BD
dd offset loc_4424BD
dd offset loc_4424BD
dd offset loc_4424A8
off_442574 dd offset loc_442358, offset	loc_442481, offset loc_442492, offset loc_4423BC
					; DATA XREF: sub_442020+2E3r
dd offset loc_44230A, offset loc_4423A7, offset	loc_4423AA, offset loc_44233A ;	jump table for switch statement
dd offset loc_442349, offset loc_44231C, offset	loc_44232B, offset loc_4423DA
dd offset loc_4424BD
byte_4425A8 db	    0,	   0,	0Ch,   0Ch ; DATA XREF:	sub_442020+2DDr
db    0Ch,   0Ch,     1,   0Ch		; indirect table for switch statement
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db	2,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,     3
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db	4,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,     5,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db	6,     6,     7,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,     8,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,     9,   0Ah,     7
db    0Ch,   0Ch,     9,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Bh,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,   0Ch,   0Ch,   0Ch
db    0Ch,     1,     1,   0Ch
db    0Ch,   0Ch,     5
align 10h
off_442640 dd offset loc_44249D, offset	loc_442428, offset loc_442481, offset loc_442492
					; DATA XREF: sub_442020+401r
dd offset loc_442349, offset loc_4423DA, offset	loc_4424B6, offset loc_4424BD ;	jump table for switch statement
byte_442660 db	    0,	   1,	  7,	 2 ; DATA XREF:	sub_442020+3FBr
db	7,     7,     2,     7		; indirect table for switch statement
db	7,     7,     7,     7
db	7,     7,     7,     7
db	7,     7,     7,     7
db	7,     2,     7,     7
db	7,     7,     2,     7
db	7,     7,     7,     7
db	7,     7,     7,     3
db	2,     3,     7,     7
db	7,     7,     7,     7
db	7,     7,     1,     7
db	7,     7,     7,     7
db	7,     7,     2,     7
db	7,     7,     7,     4
db	7,     7,     7,     7
db	7,     7,     7,     1
db	7,     1,     7,     7
db	5,     0,     0,     7
db	7,     7,     7,     7
db	7,     6
align 4
off_4426B4 dd offset loc_442492		; DATA XREF: sub_442020+45Ar
dd offset loc_442481			; jump table for switch	statement
dd offset loc_442349
dd offset loc_44249D
dd offset loc_44233A
dd offset loc_4424AD
dd offset loc_4424BD
byte_4426D0 db	    0,	   6,	  6,	 6 ; DATA XREF:	sub_442020+454r
db	6,     6,     6,     1		; indirect table for switch statement
db	2,     6,     6,     6
db	6,     6,     6,     6
db	3,     4,     3,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	6,     6,     6,     6
db	3,     5
sub_442020 endp

align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_442700(void *, int)
sub_442700 proc	near			; CODE XREF: sub_430580+5DCp
					; sub_442790+39p

arg_0= dword ptr  4
arg_4= dword ptr  8

mov	edx, [esp+arg_0]
push	esi
xor	esi, esi
cmp	edx, esi
jz	short loc_442783
mov	eax, [edx+174h]
mov	ecx, [edx+170h]
cmp	eax, esi
jz	short loc_442754
cmp	ecx, esi
jz	short loc_44273C
mov	[ecx+174h], eax
mov	ecx, [edx+170h]
push	edx				; void *
mov	[eax+170h], ecx
call	delete_mem			; operator delete(void *)
add	esp, 4
pop	esi
retn
; ---------------------------------------------------------------------------

loc_44273C:				; CODE XREF: sub_442700+1Dj
mov	ecx, [esp+4+arg_4]
mov	[eax+170h], esi
push	edx				; void *
mov	[ecx+4], eax
call	delete_mem			; operator delete(void *)
add	esp, 4
pop	esi
retn
; ---------------------------------------------------------------------------

loc_442754:				; CODE XREF: sub_442700+19j
cmp	ecx, esi
jz	short loc_442770
mov	eax, [esp+4+arg_4]
mov	[ecx+174h], esi
push	edx				; void *
mov	[eax+8], ecx
call	delete_mem			; operator delete(void *)
add	esp, 4
pop	esi
retn
; ---------------------------------------------------------------------------

loc_442770:				; CODE XREF: sub_442700+56j
mov	eax, [esp+4+arg_4]
push	edx				; void *
mov	[eax+4], esi
mov	[eax+8], esi
call	delete_mem			; operator delete(void *)
add	esp, 4

loc_442783:				; CODE XREF: sub_442700+9j
pop	esi
retn
sub_442700 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_442790 proc	near			; CODE XREF: sub_403BF0+F6p
					; sub_44BCE0+1Bp ...
push	ebx
push	ebp
push	esi
push	edi
mov	esi, offset byte_5729398

loc_442799:				; CODE XREF: sub_442790+1Cj
mov	ecx, esi
call	sub_410A00
add	esi, 0B8h
cmp	esi, offset byte_5730698
jl	short loc_442799
mov	esi, offset byte_81BDE68
xor	ebx, ebx

loc_4427B5:				; CODE XREF: sub_442790+5Bj
mov	ebp, 10h

loc_4427BA:				; CODE XREF: sub_442790+53j
mov	eax, [esi+8]

loc_4427BD:				; CODE XREF: sub_442790+47j
cmp	eax, ebx
jz	short loc_4427D9
mov	edi, [eax+170h]
push	esi				; int
push	eax				; void *
call	sub_442700
add	esp, 8
cmp	edi, ebx
jz	short loc_4427D9
mov	eax, edi
jmp	short loc_4427BD
; ---------------------------------------------------------------------------

loc_4427D9:				; CODE XREF: sub_442790+2Fj
					; sub_442790+43j
mov	[esi+4], ebx
mov	[esi+8], ebx
add	esi, 10h
dec	ebp
jnz	short loc_4427BA
cmp	esi, offset byte_81BEE68
jl	short loc_4427B5
mov	esi, 23h

loc_4427F2:				; CODE XREF: sub_442790+6Fj
push	esi
call	sub_456C70
add	esp, 4
inc	esi
cmp	esi, 67h
jle	short loc_4427F2
mov	eax, offset byte_7B114F0

loc_442806:				; CODE XREF: sub_442790+82j
mov	[eax], bl
add	eax, 178h
cmp	eax, offset byte_7B6D1B0
jl	short loc_442806
mov	eax, offset byte_81BA3A0

loc_442819:				; CODE XREF: sub_442790+95j
mov	[eax], bl
add	eax, 178h
cmp	eax, offset flt_81BDE60
jl	short loc_442819
mov	eax, offset byte_81C0678

loc_44282C:				; CODE XREF: sub_442790+A8j
mov	[eax], bl
add	eax, 178h
cmp	eax, offset dword_81C1528
jl	short loc_44282C
mov	eax, offset byte_7B029F0

loc_44283F:				; CODE XREF: sub_442790+B9j
mov	[eax], bl
add	eax, 70h
cmp	eax, offset byte_7B04CF0
jl	short loc_44283F
mov	eax, offset byte_79E1C10

loc_442850:				; CODE XREF: sub_442790+CAj
mov	[eax], bl
add	eax, 70h
cmp	eax, offset byte_7A33C90
jl	short loc_442850
mov	eax, offset byte_79DEA68

loc_442861:				; CODE XREF: sub_442790+DBj
mov	[eax], bl
add	eax, 70h
cmp	eax, offset byte_79E1628
jl	short loc_442861
mov	eax, offset byte_81BFD18

loc_442872:				; CODE XREF: sub_442790+ECj
mov	[eax], bl
add	eax, 0Ch
cmp	eax, offset byte_81C1488
jl	short loc_442872
mov	eax, offset byte_7A46250

loc_442883:				; CODE XREF: sub_442790+FFj
mov	[eax], bl
add	eax, 608h
cmp	eax, offset byte_7A91890
jl	short loc_442883
mov	eax, offset byte_7A33C90

loc_442896:				; CODE XREF: sub_442790+112j
mov	[eax], bl
add	eax, 178h
cmp	eax, offset byte_7A46250
jl	short loc_442896
pop	edi
pop	esi
pop	ebp
pop	ebx
retn
sub_442790 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_4428B0(char *)
sub_4428B0 proc	near			; CODE XREF: sub_44BCE0+ABp

var_11C= dword ptr -11Ch
var_118= dword ptr -118h
var_114= dword ptr -114h
var_110= dword ptr -110h
var_10C= dword ptr -10Ch
var_108= dword ptr -108h
var_104= dword ptr -104h
Text= byte ptr -100h
arg_0= dword ptr  4

sub	esp, 11Ch
push	esi
mov	esi, [esp+120h+arg_0]
push	edi
push	offset aRb			; "rb"
push	esi				; char *
call	_fopen
mov	edi, eax
add	esp, 8
test	edi, edi
jnz	short loc_442915
push	esi
lea	eax, [esp+128h+Text]
push	offset aSFileNotFound_		; "%s file not found."
push	eax				; char *
call	_sprintf
mov	edx, dword ptr g_hWnd1
add	esp, 0Ch
lea	ecx, [esp+124h+Text]
push	edi				; uType
push	edi				; lpCaption
push	ecx				; lpText
push	edx				; g_hWnd1
call	ds:MessageBoxA
mov	eax, dword ptr g_hWnd1
push	edi				; lParam
push	edi				; wParam
push	2				; Msg
push	eax				; g_hWnd1
call	ds:SendMessageA
pop	edi
xor	al, al
pop	esi
add	esp, 11Ch
retn
; ---------------------------------------------------------------------------

loc_442915:				; CODE XREF: sub_4428B0+21j
push	ebx
push	2				; int
push	0				; __int32
push	edi				; FILE *
call	_fseek
push	edi				; FILE *
call	_ftell
push	0				; int
push	0				; __int32
push	edi				; FILE *
mov	esi, eax
call	_fseek
push	esi				; unsigned int
call	new_mem_byte			; operator new(uint)
push	edi				; FILE *
mov	ebx, eax
push	esi				; size_t
push	1				; size_t
push	ebx				; void *
call	_fread
push	edi				; FILE *
call	_fclose
movsx	eax, word ptr [ebx+1]
add	esp, 34h
test	eax, eax
jle	short loc_4429BA
push	ebp
lea	esi, [ebx+3]
mov	ebp, eax

loc_44295B:				; CODE XREF: sub_4428B0+107j
mov	ax, [esi]
add	esi, 2
mov	ecx, esi
add	esi, 0Ch
movsx	eax, ax
mov	edx, [ecx]
mov	[esp+12Ch+var_10C], edx
mov	edx, [ecx+4]
mov	[esp+12Ch+var_108], edx
mov	edx, esi
mov	ecx, [ecx+8]
add	esi, 0Ch
mov	[esp+12Ch+var_104], ecx
mov	ecx, [edx]
mov	[esp+12Ch+var_118], ecx
add	esi, 4
mov	ecx, [edx+4]
mov	[esp+12Ch+var_114], ecx
mov	ecx, [esi-4]
mov	edx, [edx+8]
mov	[esp+12Ch+var_11C], ecx
mov	[esp+12Ch+var_110], edx
mov	edx, ecx
push	edx
lea	ecx, [esp+130h+var_118]
lea	edx, [esp+130h+var_10C]
push	ecx
push	edx
push	eax
call	sub_442020
add	esp, 10h
dec	ebp
jnz	short loc_44295B
pop	ebp

loc_4429BA:				; CODE XREF: sub_4428B0+A3j
push	ebx				; void *
call	delete_mem			; operator delete(void *)
push	edi				; FILE *
call	_fclose
add	esp, 8
mov	al, 1
pop	ebx
pop	edi
pop	esi
add	esp, 11Ch
retn
sub_4428B0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


; int __cdecl sub_4429E0(char *)
sub_4429E0 proc	near			; CODE XREF: sub_44C220+ADp

var_4= dword ptr -4
arg_0= dword ptr  4

push	ecx
mov	eax, [esp+4+arg_0]
push	ebx
push	ebp
push	esi
push	edi
push	offset aWb			; "wb"
push	eax				; char *
call	_fopen
mov	edi, eax
lea	ecx, [esp+1Ch+arg_0]
push	edi				; FILE *
push	1				; size_t
push	1				; size_t
push	ecx				; void *
mov	[esp+2Ch+var_4], 0
mov	byte ptr [esp+2Ch+arg_0], 0
call	_fwrite
push	0				; int
push	3				; __int32
push	edi				; FILE *
call	_fseek
add	esp, 24h
mov	eax, offset dword_81BDE6C

loc_442A24:				; CODE XREF: sub_4429E0+B3j
mov	ebp, eax
mov	ebx, 10h

loc_442A2B:				; CODE XREF: sub_4429E0+A9j
mov	esi, [ebp+0]
test	esi, esi
jz	short loc_442A85

loc_442A32:				; CODE XREF: sub_4429E0+A3j
cmp	byte ptr [esi],	0
jz	short loc_442A72
push	edi				; FILE *
push	1				; size_t
lea	edx, [esi+2]
push	2				; size_t
push	edx				; void *
call	_fwrite
push	edi				; FILE *
push	1				; size_t
lea	eax, [esi+0Ch]
push	0Ch				; size_t
push	eax				; void *
call	_fwrite
push	edi				; FILE *
push	1				; size_t
lea	ecx, [esi+18h]
push	0Ch				; size_t
push	ecx				; void *
call	_fwrite
push	edi				; FILE *
push	1				; size_t
lea	edx, [esi+8]
push	4				; size_t
push	edx				; void *
call	_fwrite
add	esp, 40h

loc_442A72:				; CODE XREF: sub_4429E0+55j
mov	ecx, [esp+14h+var_4]
inc	ecx
mov	[esp+14h+var_4], ecx
mov	esi, [esi+174h]
test	esi, esi
jnz	short loc_442A32

loc_442A85:				; CODE XREF: sub_4429E0+50j
add	ebp, 10h
dec	ebx
jnz	short loc_442A2B
cmp	ebp, offset byte_81BEE6C
mov	eax, ebp
jl	short loc_442A24
push	edi				; FILE *
call	_ftell
push	0				; int
push	1				; __int32
push	edi				; FILE *
mov	esi, eax
call	_fseek
push	edi				; FILE *
push	1				; size_t
lea	eax, [esp+2Ch+var_4]
push	2				; size_t
push	eax				; void *
call	_fwrite
push	0				; int
push	esi				; __int32
push	edi				; FILE *
call	_fseek
push	edi				; FILE *
call	_fclose
add	esp, 30h
mov	al, 1
pop	edi
pop	esi
pop	ebp
pop	ebx
pop	ecx
retn
sub_4429E0 endp


; =============== S U B	R O U T	I N E =======================================


sub_442AD0 proc	near			; CODE XREF: sub_407EA0+4Fp
					; sub_408750+32Dp ...

arg_0= dword ptr  4

mov	ecx, [esp+arg_0]
mov	eax, offset byte_81BEE68

loc_442AD9:				; CODE XREF: sub_442AD0+23j
cmp	byte ptr [eax],	0
jz	short loc_442AE9
cmp	[eax+0ECh], ecx
jnz	short loc_442AE9
mov	byte ptr [eax],	0

loc_442AE9:				; CODE XREF: sub_442AD0+Cj
					; sub_442AD0+14j
add	eax, 178h
cmp	eax, offset byte_81BFD18
jl	short loc_442AD9
retn
sub_442AD0 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_442B00 proc	near			; CODE XREF: sub_408750:loc_408AE0p
					; sub_419520:loc_419613p ...

arg_0= dword ptr  4
arg_4= dword ptr  8
arg_8= dword ptr  0Ch
arg_C= dword ptr  10h

mov	edx, [esp+arg_0]
push	esi
push	edi
mov	edi, [esp+8+arg_8]
cmp	word ptr [edi+2], 154h
jz	short loc_442B1E
cmp	edx, 22Eh
jnz	loc_442D0C

loc_442B1E:				; CODE XREF: sub_442B00+10j
mov	esi, offset byte_81BEE68
xor	eax, eax

loc_442B25:				; CODE XREF: sub_442B00+35j
cmp	[esi], al
jz	short loc_442B3A
add	esi, 178h
cmp	esi, offset byte_81BFD18
jl	short loc_442B25
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_442B3A:				; CODE XREF: sub_442B00+27j
mov	ecx, [esp+8+arg_C]
push	ebp
mov	[esi+4], ecx
or	ecx, 0FFFFFFFFh
mov	[esi+54h], ecx
mov	[esi+60h], ecx
mov	ecx, 3F800000h
mov	[esi+2], dx
mov	[esi+64h], ecx
mov	[esi+154h], ecx
mov	ecx, [esp+0Ch+arg_4]
mov	byte ptr [esi],	1
mov	[esi+150h], al
mov	byte ptr [esi+0CCh], 1
mov	[esi+0D4h], al
mov	[esi+151h], al
mov	[esi+100h], al
mov	[esi+0ECh], edi
mov	dword ptr [esi+8], 3F333333h
mov	dword ptr [esi+5Ch], 1Eh
mov	[esi+158h], eax
mov	ebp, [ecx]
mov	[esi+0Ch], ebp
mov	ebp, [ecx+4]
mov	[esi+10h], ebp
mov	ecx, [ecx+8]
mov	[esi+14h], ecx
mov	ecx, [edi+18h]
mov	[esi+18h], ecx
mov	ecx, [edi+1Ch]
mov	[esi+1Ch], ecx
mov	ecx, [edi+20h]
mov	[esi+0FCh], eax
mov	[esi+0F8h], eax
movsx	eax, dx
mov	[esi+20h], ecx
mov	ecx, 40400000h
sub	eax, 0C3h
mov	[esi+0D8h], ecx
mov	[esi+0DCh], ecx
mov	[esi+0E0h], ecx
mov	dword ptr [esi+0BCh], 3F000000h
pop	ebp
jz	loc_442D05
sub	eax, 16Bh
jz	loc_442C8B
dec	eax
jnz	loc_442D0C
call	_rand
and	eax, 8000007Fh
jns	short loc_442C1F
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_442C1F:				; CODE XREF: sub_442B00+118j
sub	eax, 40h
mov	[esp+8+arg_8], eax
fild	[esp+8+arg_8]
fadd	dword ptr [edi+0Ch]
fstp	dword ptr [esi+0Ch]
call	_rand
and	eax, 8000007Fh
jns	short loc_442C41
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_442C41:				; CODE XREF: sub_442B00+13Aj
sub	eax, 40h
mov	ecx, [esi+0Ch]
mov	[esp+8+arg_8], eax
fild	[esp+8+arg_8]
fadd	dword ptr [edi+10h]
fstp	dword ptr [esi+10h]
mov	eax, [esi+10h]
mov	edx, [edi+14h]
push	eax				; float
push	ecx				; float
mov	[esi+14h], edx
call	sub_43C880
fstp	[esp+10h+arg_0]
add	esp, 8
call	_rand
cdq
mov	ecx, 64h
pop	edi
idiv	ecx
mov	[esp+4+arg_8], edx
fild	[esp+4+arg_8]
fadd	[esp+4+arg_0]
fstp	dword ptr [esi+14h]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_442C8B:				; CODE XREF: sub_442B00+101j
mov	dword ptr [esi+60h], 1
call	_rand
and	eax, 800001FFh
jns	short loc_442CA5
dec	eax
or	eax, 0FFFFFE00h
inc	eax

loc_442CA5:				; CODE XREF: sub_442B00+19Cj
sub	eax, 100h
mov	[esp+8+arg_8], eax
fild	[esp+8+arg_8]
fadd	dword ptr [edi+0Ch]
fstp	dword ptr [esi+0Ch]
call	_rand
and	eax, 800001FFh
jns	short loc_442CCB
dec	eax
or	eax, 0FFFFFE00h
inc	eax

loc_442CCB:				; CODE XREF: sub_442B00+1C2j
sub	eax, 100h
mov	[esp+8+arg_8], eax
fild	[esp+8+arg_8]
fadd	dword ptr [edi+10h]
fstp	dword ptr [esi+10h]
call	_rand
and	eax, 8000007Fh
jns	short loc_442CEF
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_442CEF:				; CODE XREF: sub_442B00+1E8j
add	eax, 80h
mov	[esp+8+arg_8], eax
fild	[esp+8+arg_8]
fadd	dword ptr [edi+14h]
pop	edi
fstp	dword ptr [esi+14h]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_442D05:				; CODE XREF: sub_442B00+F6j
mov	dword ptr [esi+8], 3F666666h

loc_442D0C:				; CODE XREF: sub_442B00+18j
					; sub_442B00+108j
pop	edi
pop	esi
retn
sub_442B00 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_442D10 proc	near			; CODE XREF: sub_452000+510p
					; sub_453370:loc_4535E3p ...

var_60=	dword ptr -60h
var_5C=	dword ptr -5Ch
var_58=	dword ptr -58h
var_54=	dword ptr -54h
var_50=	dword ptr -50h
var_4C=	dword ptr -4Ch
var_48=	dword ptr -48h
var_44=	dword ptr -44h
var_40=	dword ptr -40h
var_3C=	dword ptr -3Ch
var_38=	dword ptr -38h
var_34=	dword ptr -34h
var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 60h
push	ebx
push	ebp
push	esi
push	edi
mov	edi, offset byte_81BEF54

loc_442D1C:				; CODE XREF: sub_442D10+5F3j
mov	al, [edi-0ECh]
lea	esi, [edi-0ECh]
test	al, al
jz	loc_4432F7
cmp	dword ptr nScene_482904, 5
jnz	short loc_442D4E
mov	eax, [edi]
cmp	byte ptr [eax],	0
jz	short loc_442D46
cmp	byte ptr [eax+78h], 1
jz	short loc_442D4E

loc_442D46:				; CODE XREF: sub_442D10+2Ej
mov	byte ptr [esi],	0
jmp	loc_4432F7
; ---------------------------------------------------------------------------

loc_442D4E:				; CODE XREF: sub_442D10+27j
					; sub_442D10+34j
push	esi
call	sub_40D9B0
mov	ebp, [edi]
add	esp, 4
mov	eax, [ebp+0Ch]
mov	ecx, [ebp+10h]
mov	[esp+70h+var_30], eax
mov	[esp+70h+var_2C], ecx
movsx	eax, word ptr [edi-0EAh]
lea	edx, [eax+eax*2]
shl	edx, 3
sub	edx, eax
cmp	eax, 22Eh
lea	ebx, byte_5729398[edx*8]
mov	[esp+70h+var_50], ebx
jg	loc_4430A9
jz	loc_442FD6
sub	eax, 0AFh
jz	loc_442F71
sub	eax, 14h
jnz	loc_4430B8
fld	dword ptr [ebp+10h]
fmul	dword ptr flt_478770
call	__ftol
fld	dword ptr [ebp+0Ch]
fmul	dword ptr flt_478770
push	eax
call	__ftol
push	eax
call	sub_43BE00
mov	al, byte_81AA364[eax]
add	esp, 8
and	al, 1
cmp	al, 1
jnz	short loc_442DE4
mov	dword ptr [edi+6Ch], 0
jmp	loc_4430B8
; ---------------------------------------------------------------------------

loc_442DE4:				; CODE XREF: sub_442D10+C6j
mov	eax, [edi]
lea	ebp, [edi-0D4h]
mov	ecx, [eax+0Ch]
mov	[edi-0E0h], ecx
mov	edx, [eax+10h]
mov	[edi-0DCh], edx
mov	ecx, [eax+14h]
mov	[edi-0D8h], ecx
mov	edx, [eax+18h]
mov	[ebp+0], edx
mov	ecx, [eax+1Ch]
mov	[edi-0D0h], ecx
mov	edx, [eax+20h]
mov	[edi-0CCh], edx
mov	al, [eax+0F5h]
cmp	al, 0Dh
jb	loc_442F48
cmp	al, 21h
ja	loc_442F48
push	2
push	esi
call	sub_40DC10
add	esp, 8
call	_rand
and	eax, 80000001h
jns	short loc_442E51
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_442E51:				; CODE XREF: sub_442D10+13Aj
jnz	loc_442F5F
mov	[esp+70h+var_48], 3F800000h
mov	[esp+70h+var_44], 3F800000h
mov	[esp+70h+var_40], 3F800000h
call	_rand
and	eax, 8000003Fh
jns	short loc_442E80
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_442E80:				; CODE XREF: sub_442D10+169j
sub	eax, 20h
mov	[esp+70h+var_54], eax
fild	[esp+70h+var_54]
fadd	dword ptr [edi-0E0h]
fstp	[esp+70h+var_24]
call	_rand
and	eax, 8000003Fh
jns	short loc_442EA6
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_442EA6:				; CODE XREF: sub_442D10+18Fj
sub	eax, 20h
mov	[esp+70h+var_54], eax
fild	[esp+70h+var_54]
fadd	dword ptr [edi-0DCh]
fstp	[esp+70h+var_20]
call	_rand
and	eax, 8000001Fh
jns	short loc_442ECC
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_442ECC:				; CODE XREF: sub_442D10+1B5j
sub	eax, 10h
push	0
mov	[esp+74h+var_54], eax
mov	eax, dword ptr dword_81C1528
fild	[esp+74h+var_54]
cmp	eax, 2
push	3F800000h
push	0
fadd	dword ptr [edi-0D8h]
fstp	[esp+7Ch+var_1C]
jnz	short loc_442F1E
lea	eax, [esp+7Ch+var_48]
lea	ecx, [esp+7Ch+var_24]
push	eax
push	ebp
push	ecx
push	492h
call	sub_4212F0
mov	ecx, [edi]
mov	dword ptr [edi-30h], 3EAE147Bh
add	esp, 1Ch
mov	dl, [ecx]
mov	[esi], dl
jmp	loc_4430B8
; ---------------------------------------------------------------------------

loc_442F1E:				; CODE XREF: sub_442D10+1E2j
lea	edx, [esp+7Ch+var_48]
lea	eax, [esp+7Ch+var_24]
push	edx
push	ebp
push	eax
push	493h
call	sub_4212F0
mov	ecx, [edi]
mov	dword ptr [edi-30h], 3EAE147Bh
add	esp, 1Ch
mov	dl, [ecx]
mov	[esi], dl
jmp	loc_4430B8
; ---------------------------------------------------------------------------

loc_442F48:				; CODE XREF: sub_442D10+117j
					; sub_442D10+11Fj
cmp	al, 22h
jb	short loc_442F54
cmp	al, 37h
ja	short loc_442F54
push	3
jmp	short loc_442F56
; ---------------------------------------------------------------------------

loc_442F54:				; CODE XREF: sub_442D10+23Aj
					; sub_442D10+23Ej
push	0

loc_442F56:				; CODE XREF: sub_442D10+242j
push	esi
call	sub_40DC10
add	esp, 8

loc_442F5F:				; CODE XREF: sub_442D10:loc_442E51j
mov	ecx, [edi]
mov	dword ptr [edi-30h], 3EAE147Bh
mov	dl, [ecx]
mov	[esi], dl
jmp	loc_4430B8
; ---------------------------------------------------------------------------

loc_442F71:				; CODE XREF: sub_442D10+87j
mov	[esp+70h+var_60], 42C80000h
mov	[esp+70h+var_48], 3ECCCCCDh
mov	[esp+70h+var_44], 3F19999Ah
mov	[esp+70h+var_40], 3F800000h
call	_rand
and	eax, 80000001h
jns	short loc_442FA2
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_442FA2:				; CODE XREF: sub_442D10+28Bj
jnz	loc_4430B8
push	0
push	3F800000h
lea	eax, [esp+78h+var_48]
push	1
lea	ecx, [edi-0D4h]
push	eax
lea	edx, [edi-0E0h]
push	ecx
push	edx
push	492h
call	sub_4212F0
add	esp, 1Ch
jmp	loc_4430B8
; ---------------------------------------------------------------------------

loc_442FD6:				; CODE XREF: sub_442D10+7Cj
mov	[esp+70h+var_18], 3ECCCCCDh
mov	[esp+70h+var_14], 3ECCCCCDh
mov	[esp+70h+var_10], 3ECCCCCDh
lea	ebx, [edi-0D4h]
mov	ebp, 4

loc_442FF9:				; CODE XREF: sub_442D10+38Dj
call	_rand
and	eax, 8000000Fh
jns	short loc_44300A
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_44300A:				; CODE XREF: sub_442D10+2F3j
sub	eax, 8
mov	[esp+70h+var_54], eax
fild	[esp+70h+var_54]
fstp	[esp+70h+var_3C]
call	_rand
and	eax, 8000000Fh
jns	short loc_44302A
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_44302A:				; CODE XREF: sub_442D10+313j
sub	eax, 8
mov	[esp+70h+var_54], eax
fild	[esp+70h+var_54]
fstp	[esp+70h+var_38]
call	_rand
and	eax, 8000000Fh
jns	short loc_44304A
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_44304A:				; CODE XREF: sub_442D10+333j
sub	eax, 8
push	0
mov	[esp+74h+var_54], eax
push	3F800000h
fild	[esp+78h+var_54]
fld	[esp+78h+var_3C]
fadd	dword ptr [edi-0E0h]
lea	eax, [esp+78h+var_18]
push	1
push	eax
lea	ecx, [esp+80h+var_3C]
push	ebx
push	ecx
fstp	[esp+88h+var_3C]
fld	[esp+88h+var_38]
fadd	dword ptr [edi-0DCh]
push	465h
fstp	[esp+8Ch+var_38]
fadd	dword ptr [edi-0D8h]
fstp	[esp+8Ch+var_34]
call	sub_4212F0
add	esp, 1Ch
dec	ebp
jnz	loc_442FF9
mov	ebx, [esp+70h+var_50]
jmp	short loc_4430B0
; ---------------------------------------------------------------------------

loc_4430A9:				; CODE XREF: sub_442D10+76j
cmp	eax, 22Fh
jnz	short loc_4430B8

loc_4430B0:				; CODE XREF: sub_442D10+397j
mov	[esp+70h+var_60], 43160000h

loc_4430B8:				; CODE XREF: sub_442D10+90j
					; sub_442D10+CFj ...
mov	dl, [esi+0F5h]
lea	eax, [esi+18h]
mov	[ebx+0A0h], dl
lea	ebp, [esi+0Ch]
push	eax				; int
mov	eax, [esi+0BCh]
push	ebp				; int
lea	ecx, [esi+0F6h]
push	eax				; float
lea	edx, [esi+0FCh]
push	ecx				; int
lea	eax, [esi+0F8h]
push	edx				; int
push	eax				; int
mov	ecx, ebx
call	sub_40FFA0
mov	ax, [esi+2]
cmp	ax, 22Eh
jz	short loc_443103
cmp	ax, 22Fh
jnz	loc_4432F7

loc_443103:				; CODE XREF: sub_442D10+3E7j
mov	ecx, [ebp+0]
mov	edx, [esi+10h]
fld	[esp+70h+var_30]
mov	[esp+70h+var_58], ecx
mov	[esp+70h+var_5C], edx
fsub	[esp+70h+var_58]
fld	[esp+70h+var_2C]
fsub	[esp+70h+var_5C]
fld	st
fmul	st, st(1)
fld	st(2)
fmul	st, st(3)
faddp	st(1), st
fst	[esp+70h+var_4C]
fstp	st(2)
fstp	st
fld	[esp+70h+var_60]
fmul	[esp+70h+var_60]
fstp	[esp+70h+var_54]
fcomp	[esp+70h+var_54]
fnstsw	ax
test	ah, 1
jnz	short loc_44317C
mov	eax, [esp+70h+var_2C]
mov	ecx, [esp+70h+var_30]
push	eax				; float
mov	eax, [esp+74h+var_58]
push	ecx				; float
push	edx				; float
push	eax				; float
call	sub_40D440
fstp	[esp+80h+var_50]
mov	ecx, [esp+80h+var_50]
mov	edx, [esi+20h]
push	41A00000h			; float
push	ecx				; float
push	edx				; float
call	sub_40D5A0
fstp	dword ptr [esi+20h]
add	esp, 1Ch

loc_44317C:				; CODE XREF: sub_442D10+438j
lea	ebx, [esi+80h]
lea	eax, [esi+18h]
push	ebx
push	eax
call	sub_43F530
lea	ecx, [esp+78h+var_C]
lea	eax, [esi+0B0h]
push	ecx
push	ebx
push	eax
call	sub_43F830
fld	[esp+84h+var_C]
fadd	dword ptr [ebp+0]
add	esp, 14h
fstp	dword ptr [ebp+0]
fld	[esp+70h+var_8]
fadd	dword ptr [esi+10h]
fstp	dword ptr [esi+10h]
fld	[esp+70h+var_4]
fadd	dword ptr [esi+14h]
fstp	dword ptr [esi+14h]
call	_rand
and	eax, 8000000Fh
jns	short loc_4431D0
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_4431D0:				; CODE XREF: sub_442D10+4B9j
sub	eax, 8
mov	[esp+70h+var_50], eax
fild	[esp+70h+var_50]
fadd	dword ptr [esi+14h]
fstp	dword ptr [esi+14h]
call	_rand
and	eax, 8000001Fh
jns	short loc_4431F2
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_4431F2:				; CODE XREF: sub_442D10+4DBj
jnz	loc_4432A7
fld	[esp+70h+var_4C]
fcomp	[esp+70h+var_54]
fnstsw	ax
test	ah, 1
jnz	short loc_44322D
call	_rand
and	eax, 8000003Fh
jns	short loc_443218
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_443218:				; CODE XREF: sub_442D10+501j
add	eax, 80h
mov	[esp+70h+var_4C], eax
fild	[esp+70h+var_4C]
fmul	dword ptr flt_478800
jmp	short loc_44326F
; ---------------------------------------------------------------------------

loc_44322D:				; CODE XREF: sub_442D10+4F5j
call	_rand
and	eax, 8000003Fh
jns	short loc_44323E
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_44323E:				; CODE XREF: sub_442D10+527j
add	eax, 10h
mov	[esp+70h+var_4C], eax
fild	[esp+70h+var_4C]
fmul	dword ptr flt_478800
fstp	[esp+70h+var_50]
call	_rand
cdq
mov	ecx, 168h
idiv	ecx
mov	[esp+70h+var_4C], edx
fild	[esp+70h+var_4C]
fstp	dword ptr [esi+20h]
fld	[esp+70h+var_50]

loc_44326F:				; CODE XREF: sub_442D10+51Bj
fstp	dword ptr [esi+0B4h]
mov	dword ptr [esi+0B0h], 0
call	_rand
and	eax, 8000003Fh
jns	short loc_443290
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_443290:				; CODE XREF: sub_442D10+579j
sub	eax, 20h
mov	[esp+70h+var_4C], eax
fild	[esp+70h+var_4C]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+0B8h]

loc_4432A7:				; CODE XREF: sub_442D10:loc_4431F2j
mov	ecx, [esi+0ECh]
fld	dword ptr [ecx+14h]
fadd	dword ptr flt_4786CC
fcomp	dword ptr [esi+14h]
fnstsw	ax
test	ah, 41h
jnz	short loc_4432D2
fld	dword ptr [esi+0B8h]
fadd	dword ptr flt_478794
fstp	dword ptr [esi+0B8h]

loc_4432D2:				; CODE XREF: sub_442D10+5AEj
fld	dword ptr [ecx+14h]
fadd	dword ptr flt_478854
fcomp	dword ptr [esi+14h]
fnstsw	ax
test	ah, 1
jz	short loc_4432F7
fld	dword ptr [esi+0B8h]
fsub	dword ptr flt_478794
fstp	dword ptr [esi+0B8h]

loc_4432F7:				; CODE XREF: sub_442D10+1Aj
					; sub_442D10+39j ...
add	edi, 178h
cmp	edi, offset byte_81BFE04
jl	loc_442D1C
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 60h
retn
sub_442D10 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_443320 proc	near			; CODE XREF: sub_452CD0+78p
					; sub_454200:loc_454442p ...

var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 10h
push	ebx
push	ebp
push	esi
push	edi
mov	esi, offset byte_81BEFB8
mov	ebp, 22Eh

loc_443331:				; CODE XREF: sub_443320+F5j
mov	al, [esi-150h]
lea	edi, [esi-150h]
test	al, al
jz	loc_443409
fld	dword ptr [esi-140h]
fmul	dword ptr flt_478754
push	0C1A00000h			; float
push	ecx
lea	ebx, [esi-144h]
fstp	[esp+28h+var_28]		; float
fld	dword ptr [ebx]
fmul	dword ptr flt_478754
push	ecx
fstp	[esp+2Ch+var_2C]		; float
call	sub_43E450
add	esp, 0Ch
mov	[esi], al
test	al, al
jz	loc_443409
mov	eax, [esi-64h]
cmp	word ptr [eax+2], 154h
jz	short loc_443392
cmp	[esi-14Eh], bp
jnz	short loc_443409

loc_443392:				; CODE XREF: sub_443320+67j
push	0				; float
push	0				; int
push	edi				; int
call	sub_43FF60
add	esp, 0Ch
call	_rand
cdq
mov	ecx, 1Eh
idiv	ecx
add	edx, 46h
cmp	[esi-14Eh], bp
mov	[esp+20h+var_10], edx
fild	[esp+20h+var_10]
fmul	dword ptr flt_478754
jnz	short loc_443407
fld	st
fmul	dword ptr flt_4786E0
push	0
push	0
lea	edx, [esp+28h+var_C]
push	edi
push	edx
push	3F800000h
fstp	[esp+34h+var_C]
push	ebx
push	44Ch
fld	st
fmul	dword ptr flt_478750
fstp	[esp+3Ch+var_8]
fmul	dword ptr flt_4787DC
fstp	[esp+3Ch+var_4]
call	sub_41B9C0
add	esp, 1Ch
jmp	short loc_443409
; ---------------------------------------------------------------------------

loc_443407:				; CODE XREF: sub_443320+A4j
fstp	st

loc_443409:				; CODE XREF: sub_443320+1Fj
					; sub_443320+58j ...
add	esi, 178h
cmp	esi, offset byte_81BFE68
jl	loc_443331
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 10h
retn
sub_443320 endp

; ---------------------------------------------------------------------------
align 10h
; START	OF FUNCTION CHUNK FOR sub_40AF40

loc_443430:				; CODE XREF: sub_40AF40+12j
mov	eax, offset byte_81BA3A0

loc_443435:				; CODE XREF: sub_40AF40+38502j
mov	byte ptr [eax],	0
add	eax, 178h
cmp	eax, offset flt_81BDE60
jl	short loc_443435
retn
; END OF FUNCTION CHUNK	FOR sub_40AF40
; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_443450 proc	near			; CODE XREF: sub_455510+128p

var_54=	dword ptr -54h
var_50=	dword ptr -50h
var_38=	dword ptr -38h
var_34=	dword ptr -34h
var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 38h
push	ebx
push	ebp
push	esi
push	edi
mov	esi, offset byte_81BA3A2

loc_44345C:				; CODE XREF: sub_443450+216j
fld	dword ptr [esi+1Eh]
fadd	dword ptr flt_4786E8
mov	al, [esi-2]
lea	ebx, [esi-2]
test	al, al
fstp	dword ptr [esi+1Eh]
jz	loc_44364B
fld	dword ptr [esi+0Eh]
fmul	dword ptr flt_478754
push	0C1A00000h			; float
push	ecx
lea	ebp, [esi+0Ah]
fstp	[esp+50h+var_50]		; float
fld	dword ptr [ebp+0]
fmul	dword ptr flt_478754
push	ecx
fstp	[esp+54h+var_54]		; float
call	sub_43E450
add	esp, 0Ch
mov	[esi+14Eh], al
test	al, al
jz	loc_44364B
push	0				; float
push	0				; int
push	ebx				; int
call	sub_43FF60
add	esp, 0Ch
cmp	word ptr [esi],	0AFh
jnz	short loc_44351B
call	_rand
and	eax, 8000001Fh
jns	short loc_4434D3
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_4434D3:				; CODE XREF: sub_443450+7Cj
add	eax, 40h
push	0
mov	[esp+4Ch+var_38], eax
push	0
fild	[esp+50h+var_38]
lea	eax, [esp+50h+var_18]
push	ebx
push	eax
push	3F800000h
fmul	dword ptr flt_478754
push	ebp
push	44Ch
fld	st
fmul	dword ptr flt_47870C
fstp	[esp+64h+var_18]
fmul	dword ptr flt_47874C
fst	[esp+64h+var_14]
fstp	[esp+64h+var_10]
call	sub_41B9C0
add	esp, 1Ch

loc_44351B:				; CODE XREF: sub_443450+70j
mov	cx, [esi]
movsx	eax, cx
lea	edx, [eax+eax*2]
shl	edx, 3
sub	edx, eax
cmp	cx, 10Fh
lea	edi, byte_5729398[edx*8]
jnz	loc_4435DD
lea	eax, [esp+48h+var_30]
push	0
lea	ecx, [esp+4Ch+var_C]
push	eax
push	ecx
push	offset dword_688D7B8
mov	ecx, edi
mov	[esp+58h+var_C], 0
mov	[esp+58h+var_8], 0C2480000h
mov	[esp+58h+var_4], 0
call	sub_40FEA0
push	0
push	0
lea	edx, [esp+50h+var_24]
push	ebx
push	edx
lea	eax, [esp+58h+var_30]
push	3F800000h
push	eax
push	475h
mov	[esp+64h+var_24], 3F800000h
mov	[esp+64h+var_20], 0
mov	[esp+64h+var_1C], 0
call	sub_41B9C0
push	0
push	3F800000h
lea	ecx, [esp+6Ch+var_24]
push	0
lea	edx, [esi+16h]
push	ecx
lea	eax, [esp+74h+var_30]
push	edx
push	eax
push	479h
mov	[esp+80h+var_24], 3F800000h
mov	[esp+80h+var_20], 3F800000h
mov	[esp+80h+var_1C], 3F800000h
call	sub_4212F0
add	esp, 38h

loc_4435DD:				; CODE XREF: sub_443450+E5j
push	1
call	sub_44E240
add	esp, 4
push	3E4CCCCDh			; alpha
push	0				; blue
push	0				; green
push	0				; red
call	ds:glColor4f
fld	dword ptr [ebp+0]
mov	ecx, [esi+12h]
fst	[esp+48h+var_34]
fstp	[esp+48h+var_30]
fld	dword ptr [esi+0Eh]
mov	eax, [esp+48h+var_34]
mov	[esp+48h+var_28], ecx
fst	[esp+48h+var_38]
mov	edx, [esp+48h+var_38]
fstp	[esp+48h+var_2C]
push	edx				; float
push	eax				; float
call	sub_43C880
mov	ecx, [esp+50h+var_30]
add	esp, 8
fstp	[esp+48h+var_28]
mov	[edi+6Ch], ecx
mov	edx, [esp+48h+var_2C]
mov	[edi+70h], edx
mov	eax, [esp+48h+var_28]
push	0FFFFFFFFh
push	0FFFFFFFFh
mov	ecx, edi
mov	[edi+74h], eax
call	sub_410870

loc_44364B:				; CODE XREF: sub_443450+20j
					; sub_443450+58j
fld	dword ptr [esi+1Eh]
fsub	dword ptr flt_4786E8
add	esi, 178h
cmp	esi, (offset flt_81BDE60+2)
fstp	dword ptr [esi-15Ah]
jl	loc_44345C
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 38h
retn
sub_443450 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_443680 proc	near			; CODE XREF: sub_455310:loc_45547Ap

var_54=	dword ptr -54h
var_40=	dword ptr -40h
var_3C=	dword ptr -3Ch
var_38=	dword ptr -38h
var_34=	dword ptr -34h
var_30=	dword ptr -30h
var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

mov	al, byte_81C152C
sub	esp, 40h
push	ebx
push	ebp
push	esi
push	edi
or	edi, 0FFFFFFFFh
xor	ebp, ebp
test	al, al
jz	loc_443792
mov	esi, dword ptr dword_79DBE88
call	_rand
cdq
mov	ecx, 28h
idiv	ecx
test	edx, edx
jnz	loc_44375E
call	_rand
cdq
mov	ecx, 258h
idiv	ecx
sub	edx, 0C8h
mov	[esp+50h+var_38], edx
mov	edx, dword ptr dword_79DBE88
fild	[esp+50h+var_38]
fadd	dword ptr [edx+0Ch]
fstp	[esp+50h+var_18]
call	_rand
cdq
mov	ecx, 190h
push	ebp
idiv	ecx
mov	eax, dword ptr dword_79DBE88
push	edi
push	ebp
push	3
lea	ecx, [esp+60h+var_18]
add	edx, 0C8h
mov	[esp+60h+var_38], edx
lea	edx, [esp+60h+var_30]
fild	[esp+60h+var_38]
push	edx
fadd	dword ptr [eax+10h]
fstp	[esp+64h+var_14]
fld	dword ptr [eax+14h]
fadd	dword ptr flt_478984
lea	eax, [esp+64h+var_24]
mov	[esp+64h+var_24], ebp
push	eax
push	ecx
push	0BFh
mov	[esp+70h+var_20], ebp
fstp	[esp+70h+var_10]
mov	[esp+70h+var_1C], ebp
mov	[esp+70h+var_30], 3F800000h
mov	[esp+70h+var_2C], 3F800000h
mov	[esp+70h+var_28], 3F800000h
call	sub_41E430
push	ebp
push	ebp
push	2Eh
call	sub_401570
add	esp, 2Ch

loc_44375E:				; CODE XREF: sub_443680+2Ej
mov	[esp+50h+var_30], 0BE99999Ah
mov	[esp+50h+var_2C], 0BE99999Ah
mov	[esp+50h+var_28], 0BE4CCCCDh
mov	eax, [esi+10h]
mov	ecx, [esi+0Ch]
push	offset dword_7FE9D40		; int
lea	edx, [esp+54h+var_30]
push	10h				; int
push	edx				; int
push	eax				; float
push	ecx				; float
call	sub_43CA40
add	esp, 14h

loc_443792:				; CODE XREF: sub_443680+13j
mov	esi, dword ptr dword_79DBE88
fld	dword ptr [esi+10h]
fmul	dword ptr flt_478770
call	__ftol
fld	dword ptr [esi+0Ch]
fmul	dword ptr flt_478770
push	eax
call	__ftol
push	eax
call	sub_43BE00
mov	[esp+58h+var_38], eax
mov	eax, dword ptr dword_81C1528
add	esp, 8
mov	[esp+50h+var_40], ebp
mov	ebx, 3F800000h
mov	ecx, ebp

loc_4437D2:				; CODE XREF: sub_443680+CBFj
cmp	eax, 7
jz	short loc_4437E0
cmp	ecx, 5
jge	loc_444333

loc_4437E0:				; CODE XREF: sub_443680+155j
lea	edx, [ecx+ecx*2]
shl	edx, 4
sub	edx, ecx
mov	cl, byte_81BA3A0[edx*8]
test	cl, cl
lea	esi, byte_81BA3A0[edx*8]
jnz	loc_443B37
mov	cl, byte_81C152C
test	cl, cl
jz	loc_44391B
call	_rand
cdq
mov	ecx, 12Ch
idiv	ecx
test	edx, edx
jnz	loc_443B29
push	1Fh
mov	byte ptr [esi],	1
call	sub_448700
add	esp, 4
mov	word ptr [esi+2], 10Fh
call	_rand
cdq
mov	ecx, 3
mov	[esi+158h], ebx
idiv	ecx
mov	dword ptr [esi+0BCh], 3F000000h
mov	byte ptr [esi+0CCh], 1
mov	byte ptr [esi+151h], 0
mov	[esi+4], ebp
mov	[esi+54h], edi
mov	[esi+60h], edi
add	edx, 6
mov	[esp+50h+var_3C], edx
fild	[esp+50h+var_3C]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+8]
call	_rand
and	eax, 8000007Fh
jns	short loc_44388D
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_44388D:				; CODE XREF: sub_443680+206j
add	eax, 80h
mov	[esi+5Ch], eax
call	_rand
cdq
mov	ecx, 0Ah
mov	[esi+18h], ebp
idiv	ecx
mov	[esi+1Ch], ebp
mov	dword ptr [esi+20h], 0C2B40000h
mov	[esp+50h+var_3C], edx
fild	[esp+50h+var_3C]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+74h]
call	_rand
cdq
mov	ecx, 258h
idiv	ecx
sub	edx, 64h
mov	[esp+50h+var_3C], edx
mov	edx, dword ptr dword_79DBE88
fild	[esp+50h+var_3C]
fadd	dword ptr [edx+0Ch]
fstp	dword ptr [esi+0Ch]
call	_rand
cdq
mov	ecx, 190h
idiv	ecx
mov	eax, dword ptr dword_79DBE88
add	edx, 0C8h
mov	[esp+50h+var_3C], edx
fild	[esp+50h+var_3C]
fadd	dword ptr [eax+10h]
fstp	dword ptr [esi+10h]
fld	dword ptr [eax+14h]
fadd	dword ptr flt_478984
fstp	dword ptr [esi+14h]
jmp	loc_443B29
; ---------------------------------------------------------------------------

loc_44391B:				; CODE XREF: sub_443680+186j
cmp	eax, ebp
jz	short loc_44394E
cmp	eax, 1
jz	short loc_44394E
cmp	eax, 3
jz	short loc_44394E
cmp	eax, 4
jz	short loc_44394E
cmp	eax, 7
jnz	loc_443B2E
mov	edx, [esp+50h+var_38]
mov	cl, byte_81AA364[edx]
test	cl, cl
jz	short loc_44394E
cmp	cl, 2
jnz	loc_443B2E

loc_44394E:				; CODE XREF: sub_443680+29Dj
					; sub_443680+2A2j ...
mov	ecx, 3F000000h
cmp	eax, ebp
mov	byte ptr [esi],	1
mov	[esi+0BCh], ebx
mov	byte ptr [esi+0CCh], 1
mov	[esi+5Ch], ebp
mov	[esi+4], ebp
mov	[esi+0D8h], ecx
mov	[esi+0DCh], ecx
mov	[esi+0E0h], ecx
mov	[esi+158h], ebp
mov	[esi+154h], ebx
mov	dword ptr [esi+0C8h], 41500000h
jnz	short loc_4439A0
mov	word ptr [esi+2], 0AEh
jmp	loc_443A51
; ---------------------------------------------------------------------------

loc_4439A0:				; CODE XREF: sub_443680+313j
cmp	eax, 1
jz	loc_443A4B
cmp	eax, 4
jz	loc_443A4B
cmp	eax, 3
jnz	short loc_4439E2
mov	word ptr [esi+2], 0AFh

loc_4439BD:				; CODE XREF: sub_443680+3BAj
mov	dword ptr [esi+0BCh], 3E99999Ah

loc_4439C7:				; CODE XREF: sub_443680+3C6j
mov	byte ptr [esi+0CCh], 0
mov	[esi+0D8h], ebx
mov	[esi+0DCh], ebx
mov	[esi+0E0h], ebx
jmp	short loc_443A51
; ---------------------------------------------------------------------------

loc_4439E2:				; CODE XREF: sub_443680+335j
cmp	eax, 7
jnz	short loc_443A51
mov	eax, dword ptr dword_79DBE88
fld	dword ptr [eax+10h]
fmul	dword ptr flt_478754
fcomp	dword ptr flt_47883C
fnstsw	ax
test	ah, 1
jz	loc_44434D
call	_rand
and	eax, 80000001h
jns	short loc_443A17
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_443A17:				; CODE XREF: sub_443680+390j
add	eax, 0B4h
mov	dword ptr [esi+0C8h], 41700000h
mov	[esi+2], ax
call	_rand
cdq
mov	ecx, 64h
idiv	ecx
cmp	edx, 5Ah
jl	loc_4439BD
mov	dword ptr [esi+0BCh], 3E800000h
jmp	loc_4439C7
; ---------------------------------------------------------------------------

loc_443A4B:				; CODE XREF: sub_443680+323j
					; sub_443680+32Cj
mov	word ptr [esi+2], 0B0h

loc_443A51:				; CODE XREF: sub_443680+31Bj
					; sub_443680+360j ...
mov	byte ptr [esi+151h], 1
mov	dword ptr [esi+8], 3F4CCCCDh
mov	dword ptr [esi+0C4h], 41200000h
mov	[esi+54h], edi
mov	[esi+60h], edi
call	_rand
cdq
mov	ecx, 13Ah
idiv	ecx
mov	[esp+50h+var_3C], edx
fild	[esp+50h+var_3C]
fmul	dword ptr flt_478754
fstp	dword ptr [esi+74h]
call	_rand
and	eax, 800003FFh
jns	short loc_443AA0
dec	eax
or	eax, 0FFFFFC00h
inc	eax

loc_443AA0:				; CODE XREF: sub_443680+417j
mov	edx, dword ptr dword_79DBE88
sub	eax, 200h
mov	[esp+50h+var_3C], eax
fild	[esp+50h+var_3C]
fadd	dword ptr [edx+0Ch]
fstp	dword ptr [esi+0Ch]
call	_rand
and	eax, 800003FFh
jns	short loc_443ACC
dec	eax
or	eax, 0FFFFFC00h
inc	eax

loc_443ACC:				; CODE XREF: sub_443680+443j
sub	eax, 200h
mov	edx, [esi+0Ch]
mov	[esp+50h+var_3C], eax
mov	eax, dword ptr dword_79DBE88
fild	[esp+50h+var_3C]
fadd	dword ptr [eax+10h]
fstp	dword ptr [esi+10h]
mov	ecx, [esi+10h]
mov	eax, [eax+14h]
push	ecx				; float
push	edx				; float
mov	[esi+14h], eax
call	sub_43C880
fstp	[esp+58h+var_34]
add	esp, 8
call	_rand
cdq
mov	ecx, 0C8h
mov	[esi+18h], ebp
idiv	ecx
mov	[esi+1Ch], ebp
mov	[esi+20h], ebp
add	edx, 96h
mov	[esp+50h+var_3C], edx
fild	[esp+50h+var_3C]
fadd	[esp+50h+var_34]
fstp	dword ptr [esi+14h]

loc_443B29:				; CODE XREF: sub_443680+19Bj
					; sub_443680+296j
mov	eax, dword ptr dword_81C1528

loc_443B2E:				; CODE XREF: sub_443680+2B1j
					; sub_443680+2C8j
cmp	byte ptr [esi],	0
jz	loc_444333

loc_443B37:				; CODE XREF: sub_443680+178j
mov	cx, [esi+2]
movsx	eax, cx
lea	edx, [eax+eax*2]
shl	edx, 3
sub	edx, eax
cmp	cx, 10Fh
lea	edi, byte_5729398[edx*8]
jnz	loc_443C79
push	7
push	esi
call	sub_40DC10
mov	al, [esi+0F5h]
add	esp, 8
lea	ebx, [esi+18h]
lea	ebp, [esi+0Ch]
push	ebx				; int
push	ebp				; int
lea	ecx, [esi+0F6h]
mov	[edi+0A0h], al
push	3F000000h			; float
lea	edx, [esi+0FCh]
push	ecx				; int
lea	eax, [esi+0F8h]
push	edx				; int
push	eax				; int
mov	ecx, edi
call	sub_40FFA0
lea	edi, [esi+80h]
push	edi
push	ebx
call	sub_43F530
fld	dword ptr [esi+8]
fmul	dword ptr flt_478790
lea	ecx, [esp+58h+var_C]
lea	edx, [esp+58h+var_18]
push	ecx
push	edi
push	edx
mov	[esp+64h+var_14], 0
fstp	[esp+64h+var_18]
mov	[esp+64h+var_10], 0
call	sub_43F830
fld	[esp+64h+var_C]
fadd	dword ptr [ebp+0]
fst	[esp+64h+var_3C]
fstp	dword ptr [ebp+0]
fld	[esp+64h+var_8]
fadd	dword ptr [esi+10h]
mov	ecx, [esp+64h+var_3C]
fst	[esp+64h+var_34]
fstp	dword ptr [esi+10h]
fld	[esp+64h+var_4]
fadd	dword ptr [esi+14h]
mov	eax, [esp+64h+var_34]
push	eax				; float
push	ecx				; float
fstp	dword ptr [esi+14h]
call	sub_43C880
fadd	dword ptr flt_478984
add	esp, 18h
fstp	dword ptr [esi+14h]
fld	dword ptr [esi+74h]
fsin
fstp	[esp+54h+var_54]		; float
call	sub_44F310
fmul	dword ptr flt_4786CC
mov	ecx, [esi+5Ch]
add	esp, 4
dec	ecx
fsubr	dword ptr [esi+14h]
mov	eax, ecx
mov	[esi+5Ch], ecx
test	eax, eax
fadd	dword ptr flt_4786CC
fstp	dword ptr [esi+14h]
fld	dword ptr [esi+8]
fmul	dword ptr flt_478704
fadd	dword ptr [esi+74h]
fstp	dword ptr [esi+74h]
jg	short loc_443C54
mov	byte ptr [esi],	0

loc_443C54:				; CODE XREF: sub_443680+5CFj
call	_rand
and	eax, 8000007Fh
jns	short loc_443C65
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_443C65:				; CODE XREF: sub_443680+5DEj
jnz	loc_44431B
push	0
push	0
push	112h
jmp	loc_444313
; ---------------------------------------------------------------------------

loc_443C79:				; CODE XREF: sub_443680+4D2j
mov	dl, [esi+0F5h]
lea	eax, [esi+18h]
lea	ebp, [esi+0Ch]
push	eax				; int
push	ebp				; int
lea	eax, [esi+0F6h]
mov	[edi+0A0h], dl
push	ebx				; float
lea	ecx, [esi+0FCh]
push	eax				; int
lea	edx, [esi+0F8h]
push	ecx				; int
push	edx				; int
mov	ecx, edi
call	sub_40FFA0
mov	ax, [esi+2]
cmp	ax, 0AEh
jnz	loc_443E9D
mov	al, [esi+0F4h]
test	al, al
jnz	loc_443D86
fld	dword ptr flt_5727448
call	__ftol
and	eax, 80001FFFh
jns	short loc_443CDF
dec	eax
or	eax, 0FFFFE000h
inc	eax

loc_443CDF:				; CODE XREF: sub_443680+656j
cmp	eax, 800h
jge	short loc_443D2C
mov	eax, dword ptr dword_79DBE88
fld	dword ptr [ebp+0]
fsub	dword ptr [eax+0Ch]
fld	dword ptr [esi+10h]
fsub	dword ptr [eax+10h]
fld	st
fmul	st, st(1)
fld	st(2)
fmul	st, st(3)
faddp	st(1), st
fsqrt
fstp	st(2)
fstp	st
fcom	dword ptr flt_478854
fnstsw	ax
test	ah, 1
jnz	short loc_443D2A
fcomp	dword ptr flt_4786DC
fnstsw	ax
test	ah, 41h
jz	short loc_443D2C
mov	byte ptr [esi+0F4h], 1
jmp	short loc_443D2C
; ---------------------------------------------------------------------------

loc_443D2A:				; CODE XREF: sub_443680+692j
fstp	st

loc_443D2C:				; CODE XREF: sub_443680+664j
					; sub_443680+69Fj ...
mov	[esi+0BCh], ebx
call	_rand
and	eax, 8000000Fh
jns	short loc_443D43
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_443D43:				; CODE XREF: sub_443680+6BCj
sub	eax, 8
mov	[esp+50h+var_34], eax
fild	[esp+50h+var_34]
fadd	dword ptr [esi+14h]
fcom	dword ptr flt_478854
fst	dword ptr [esi+14h]
fnstsw	ax
test	ah, 1
jz	short loc_443D6F
fstp	st
mov	dword ptr [esi+0B8h], 41200000h
jmp	short loc_443D86
; ---------------------------------------------------------------------------

loc_443D6F:				; CODE XREF: sub_443680+6DFj
fcomp	dword ptr flt_4788AC
fnstsw	ax
test	ah, 41h
jnz	short loc_443D86
mov	dword ptr [esi+0B8h], 0C1200000h

loc_443D86:				; CODE XREF: sub_443680+640j
					; sub_443680+6EDj ...
cmp	byte ptr [esi+0F4h], 1
jnz	short loc_443DF0
mov	eax, [esi+10h]
mov	ecx, [ebp+0]
push	eax				; float
push	ecx				; float
mov	dword ptr [esi+0B8h], 0C1A00000h
call	sub_43C880
fcom	dword ptr [esi+14h]
add	esp, 8
fnstsw	ax
test	ah, 41h
jnz	short loc_443DEE
fstp	dword ptr [esi+14h]
mov	byte ptr [esi+0F4h], 2
call	_rand
and	eax, 80000003h
jns	short loc_443DCE
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_443DCE:				; CODE XREF: sub_443680+747j
add	eax, 6
mov	byte ptr [esi+0F5h], 1
mov	[esp+50h+var_34], eax
fild	[esp+50h+var_34]
fmul	dword ptr flt_478704
fstp	dword ptr [esi+0BCh]
jmp	short loc_443DF0
; ---------------------------------------------------------------------------

loc_443DEE:				; CODE XREF: sub_443680+731j
fstp	st

loc_443DF0:				; CODE XREF: sub_443680+70Dj
					; sub_443680+76Cj
cmp	byte ptr [esi+0F4h], 2
jnz	short loc_443E3F
mov	edx, dword ptr dword_79DBE88
cmp	byte ptr [edx+0F5h], 0Dh
jnb	short loc_443E1D
call	_rand
and	eax, 800000FFh
jns	short loc_443E1B
dec	eax
or	eax, 0FFFFFF00h
inc	eax

loc_443E1B:				; CODE XREF: sub_443680+792j
jnz	short loc_443E3F

loc_443E1D:				; CODE XREF: sub_443680+786j
mov	byte ptr [esi+0F4h], 3
mov	dword ptr [esi+0BCh], 3F8CCCCDh
mov	dword ptr [esi+0B8h], 41A00000h
mov	byte ptr [esi+0F5h], 0

loc_443E3F:				; CODE XREF: sub_443680+777j
					; sub_443680:loc_443E1Bj
cmp	byte ptr [esi+0F4h], 3
jnz	loc_443FEC
call	_rand
and	eax, 8000000Fh
jns	short loc_443E5D
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_443E5D:				; CODE XREF: sub_443680+7D6j
sub	eax, 8
mov	[esp+50h+var_34], eax
fild	[esp+50h+var_34]
fadd	dword ptr [esi+14h]
fstp	dword ptr [esi+14h]
fld	dword ptr [esi+0BCh]
fsub	dword ptr flt_4787E0
fst	dword ptr [esi+0BCh]
fcomp	dword ptr flt_4786B8
fnstsw	ax
test	ah, 41h
jz	loc_443FEC
mov	byte ptr [esi+0F4h], 0
jmp	loc_443FEC
; ---------------------------------------------------------------------------

loc_443E9D:				; CODE XREF: sub_443680+632j
cmp	ax, 0B0h
jnz	short loc_443EE9
mov	eax, [esi+10h]
mov	ecx, [ebp+0]
push	eax				; float
push	ecx				; float
call	sub_43C880
fstp	dword ptr [esi+14h]
fld	dword ptr [esi+74h]
fsin
add	esp, 4
fstp	[esp+54h+var_54]		; float
call	sub_44F310
fmul	dword ptr flt_478824
add	esp, 4
fsubr	dword ptr [esi+14h]
fadd	dword ptr flt_4789B0
fstp	dword ptr [esi+14h]
fld	dword ptr [esi+74h]
fadd	dword ptr flt_47870C
fstp	dword ptr [esi+74h]
jmp	loc_443FEC
; ---------------------------------------------------------------------------

loc_443EE9:				; CODE XREF: sub_443680+821j
cmp	ax, 0AFh
jnz	loc_443FEC
call	_rand
and	eax, 8000001Fh
jns	short loc_443F04
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_443F04:				; CODE XREF: sub_443680+87Dj
jnz	short loc_443F3C
call	_rand
cdq
mov	ecx, 168h
idiv	ecx
mov	[esp+50h+var_34], edx
fild	[esp+50h+var_34]
fstp	dword ptr [esi+20h]
call	_rand
cdq
mov	ecx, 0Fh
idiv	ecx
sub	edx, 7
mov	[esp+50h+var_34], edx
fild	[esp+50h+var_34]
fstp	dword ptr [esi+0B8h]

loc_443F3C:				; CODE XREF: sub_443680:loc_443F04j
call	_rand
cdq
mov	ecx, 0Fh
idiv	ecx
mov	eax, [ebp+0]
sub	edx, 7
mov	[esp+50h+var_34], edx
mov	edx, [esi+10h]
fild	[esp+50h+var_34]
push	edx				; float
push	eax				; float
fmul	dword ptr flt_47870C
fadd	dword ptr [esi+0B8h]
fstp	dword ptr [esi+0B8h]
call	sub_43C880
fld	st
fadd	dword ptr flt_4786D0
add	esp, 8
fcomp	dword ptr [esi+14h]
fnstsw	ax
test	ah, 41h
jnz	short loc_443FA0
fld	dword ptr [esi+0B8h]
fmul	dword ptr flt_478750
fadd	dword ptr flt_4786B8
fstp	dword ptr [esi+0B8h]

loc_443FA0:				; CODE XREF: sub_443680+906j
fadd	dword ptr flt_478984
fcomp	dword ptr [esi+14h]
fnstsw	ax
test	ah, 1
jz	short loc_443FC8
fld	dword ptr [esi+0B8h]
fmul	dword ptr flt_478750
fsub	dword ptr flt_4786B8
fstp	dword ptr [esi+0B8h]

loc_443FC8:				; CODE XREF: sub_443680+92Ej
call	_rand
cdq
mov	ecx, 0Fh
idiv	ecx
sub	edx, 7
mov	[esp+50h+var_34], edx
fild	[esp+50h+var_34]
fmul	dword ptr flt_478758
fadd	dword ptr [esi+14h]
fstp	dword ptr [esi+14h]

loc_443FEC:				; CODE XREF: sub_443680+7C6j
					; sub_443680+80Bj ...
cmp	byte ptr [esi+0F4h], 2
jz	loc_44421C
cmp	word ptr [esi+2], 0AFh
jnz	short loc_444014
call	_rand
and	eax, 80000003h
jns	short loc_444012
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_444012:				; CODE XREF: sub_443680+98Bj
jnz	short loc_444029

loc_444014:				; CODE XREF: sub_443680+97Fj
mov	edx, [esp+50h+var_40]
push	28h				; int
push	offset byte_81BA3A0		; float
push	edx				; float
push	esi				; float
call	sub_40DA70
add	esp, 10h

loc_444029:				; CODE XREF: sub_443680:loc_444012j
lea	edi, [esi+80h]
lea	eax, [esi+18h]
push	edi
push	eax
call	sub_43F530
mov	eax, dword ptr dword_81C1528
add	esp, 8
cmp	eax, 7
jnz	loc_444154
fld	dword ptr [esi+74h]
fcomp	dword ptr flt_478764
fnstsw	ax
test	ah, 1
jz	loc_4440F0
cmp	[esp+50h+var_40], 23h
jge	short loc_4440AC
call	_rand
and	eax, 8000000Fh
jns	short loc_444076
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_444076:				; CODE XREF: sub_443680+9EFj
add	eax, 8
mov	[esp+50h+var_2C], 0
mov	[esp+50h+var_34], eax
mov	eax, [esi+0B8h]
fild	[esp+50h+var_34]
mov	[esp+50h+var_28], eax
mov	dword ptr [esi+0C8h], 41700000h
fmul	dword ptr [esi+0BCh]
fstp	[esp+50h+var_30]
jmp	loc_444132
; ---------------------------------------------------------------------------

loc_4440AC:				; CODE XREF: sub_443680+9E3j
call	_rand
and	eax, 8000000Fh
jns	short loc_4440BD
dec	eax
or	eax, 0FFFFFFF0h
inc	eax

loc_4440BD:				; CODE XREF: sub_443680+A36j
add	eax, 10h
mov	ecx, [esi+0B8h]
mov	[esp+50h+var_34], eax
mov	[esp+50h+var_2C], 0
fild	[esp+50h+var_34]
mov	[esp+50h+var_28], ecx
mov	dword ptr [esi+0C8h], 41700000h
fmul	dword ptr [esi+0BCh]
fstp	[esp+50h+var_30]
jmp	short loc_444132
; ---------------------------------------------------------------------------

loc_4440F0:				; CODE XREF: sub_443680+9D8j
call	_rand
and	eax, 8000001Fh
jns	short loc_444101
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_444101:				; CODE XREF: sub_443680+A7Aj
add	eax, 20h
mov	edx, [esi+0B8h]
mov	[esp+50h+var_34], eax
mov	[esp+50h+var_2C], 0
fild	[esp+50h+var_34]
mov	[esp+50h+var_28], edx
mov	dword ptr [esi+0C8h], 40A00000h
fmul	dword ptr [esi+0BCh]
fstp	[esp+50h+var_30]

loc_444132:				; CODE XREF: sub_443680+A27j
					; sub_443680+A6Ej
fld	dword ptr [esi+74h]
fadd	dword ptr flt_478700
fst	dword ptr [esi+74h]
fcomp	dword ptr flt_478788
fnstsw	ax
test	ah, 1
jnz	short loc_444176
mov	dword ptr [esi+74h], 0
jmp	short loc_444176
; ---------------------------------------------------------------------------

loc_444154:				; CODE XREF: sub_443680+9C4j
fld	dword ptr [esi+0BCh]
fmul	dword ptr flt_4787B4
mov	eax, [esi+0B8h]
mov	[esp+50h+var_2C], 0
mov	[esp+50h+var_28], eax
fstp	[esp+50h+var_30]

loc_444176:				; CODE XREF: sub_443680+AC9j
					; sub_443680+AD2j
lea	ecx, [esp+50h+var_24]
lea	edx, [esp+50h+var_30]
push	ecx
push	edi
push	edx
call	sub_43F830
fld	[esp+5Ch+var_24]
fadd	dword ptr [ebp+0]
add	esp, 0Ch
fst	dword ptr [ebp+0]
fld	[esp+50h+var_20]
fadd	dword ptr [esi+10h]
fstp	[esp+50h+var_3C]
fld	[esp+50h+var_1C]
fadd	dword ptr [esi+14h]
mov	eax, [esp+50h+var_3C]
mov	[esi+10h], eax
mov	eax, dword ptr dword_79DBE88
fstp	dword ptr [esi+14h]
fld	[esp+50h+var_24]
fmul	dword ptr flt_478778
fadd	st, st(1)
fstp	dword ptr [esi+0B0h]
fld	[esp+50h+var_20]
fmul	dword ptr flt_478778
fadd	[esp+50h+var_3C]
fstp	dword ptr [esi+0B4h]
fsub	dword ptr [eax+0Ch]
fld	[esp+50h+var_3C]
fsub	dword ptr [eax+10h]
fld	st
fmul	st, st(1)
fld	st(2)
fmul	st, st(3)
faddp	st(1), st
fsqrt
fstp	st(2)
fstp	st
fcomp	dword ptr flt_478A38
fnstsw	ax
test	ah, 1
jnz	short loc_444204
mov	byte ptr [esi],	0

loc_444204:				; CODE XREF: sub_443680+B7Fj
call	_rand
and	eax, 800001FFh
jns	short loc_444217
dec	eax
or	eax, 0FFFFFE00h
inc	eax

loc_444217:				; CODE XREF: sub_443680+B8Ej
jnz	short loc_44421C
mov	byte ptr [esi],	0

loc_44421C:				; CODE XREF: sub_443680+973j
					; sub_443680:loc_444217j
mov	eax, [esi+5Ch]
test	eax, eax
jg	short loc_44426D
cmp	dword ptr dword_81C1528, 7
jnz	short loc_44426D
mov	ecx, [esp+50h+var_38]
cmp	byte_81AA364[ecx], 1
jnz	short loc_44426D
fld	dword ptr [esi+20h]
fadd	dword ptr flt_4786F0
fcom	dword ptr flt_4786FC
fst	dword ptr [esi+20h]
fnstsw	ax
test	ah, 1
jnz	short loc_44425D
fsub	dword ptr flt_4786FC
fstp	dword ptr [esi+20h]
jmp	short loc_44425F
; ---------------------------------------------------------------------------

loc_44425D:				; CODE XREF: sub_443680+BD0j
fstp	st

loc_44425F:				; CODE XREF: sub_443680+BDBj
mov	eax, [esi+4]
mov	dword ptr [esi+5Ch], 0Ah
inc	eax
mov	[esi+4], eax

loc_44426D:				; CODE XREF: sub_443680+BA1j
					; sub_443680+BAAj ...
cmp	dword ptr [esi+4], 2
jl	short loc_444276
mov	byte ptr [esi],	0

loc_444276:				; CODE XREF: sub_443680+BF1j
mov	eax, [esi+5Ch]
fld	dword ptr [ebp+0]
dec	eax
mov	[esi+5Ch], eax
mov	eax, dword ptr dword_79DBE88
fsub	dword ptr [eax+0Ch]
fld	dword ptr [esi+10h]
fsub	dword ptr [eax+10h]
fld	st
fmul	st, st(1)
fld	st(2)
fmul	st, st(3)
faddp	st(1), st
fsqrt
fstp	st(2)
fstp	st
fcomp	dword ptr flt_4788AC
fnstsw	ax
test	ah, 1
jz	short loc_44431B
mov	ax, [esi+2]
cmp	ax, 0AEh
jnz	short loc_4442F3
call	_rand
and	eax, 800001FFh
jns	short loc_4442C8
dec	eax
or	eax, 0FFFFFE00h
inc	eax

loc_4442C8:				; CODE XREF: sub_443680+C3Fj
jnz	short loc_4442D7
push	0
push	esi
push	0Ch
call	sub_401570
add	esp, 0Ch

loc_4442D7:				; CODE XREF: sub_443680:loc_4442C8j
call	_rand
and	eax, 800001FFh
jns	short loc_4442EA
dec	eax
or	eax, 0FFFFFE00h
inc	eax

loc_4442EA:				; CODE XREF: sub_443680+C61j
jnz	short loc_44431B
push	0
push	esi
push	0Dh
jmp	short loc_444313
; ---------------------------------------------------------------------------

loc_4442F3:				; CODE XREF: sub_443680+C33j
cmp	ax, 0B0h
jnz	short loc_44431B
call	_rand
and	eax, 800000FFh
jns	short loc_44430C
dec	eax
or	eax, 0FFFFFF00h
inc	eax

loc_44430C:				; CODE XREF: sub_443680+C83j
jnz	short loc_44431B
push	0
push	esi
push	0Eh

loc_444313:				; CODE XREF: sub_443680+5F4j
					; sub_443680+C71j
call	sub_401570
add	esp, 0Ch

loc_44431B:				; CODE XREF: sub_443680:loc_443C65j
					; sub_443680+C29j ...
push	esi
call	sub_40D9B0
mov	eax, dword ptr dword_81C1528
add	esp, 4
or	edi, 0FFFFFFFFh
mov	ebx, 3F800000h
xor	ebp, ebp

loc_444333:				; CODE XREF: sub_443680+15Aj
					; sub_443680+4B1j
mov	ecx, [esp+50h+var_40]
inc	ecx
cmp	ecx, 28h
mov	[esp+50h+var_40], ecx
jl	loc_4437D2
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 40h
retn
; ---------------------------------------------------------------------------

loc_44434D:				; CODE XREF: sub_443680+380j
mov	byte ptr [esi],	0
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 40h
retn
sub_443680 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_444360 proc	near			; CODE XREF: sub_455510+12Dp

var_2C=	dword ptr -2Ch
var_28=	dword ptr -28h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8

sub	esp, 14h
push	ebx
mov	ebx, ds:glColor4f
push	esi
push	edi
mov	esi, offset byte_81C067A

loc_444371:				; CODE XREF: sub_444360+104j
fld	dword ptr [esi+1Eh]
fadd	dword ptr flt_4786E8
mov	al, [esi-2]
lea	edi, [esi-2]
test	al, al
fstp	dword ptr [esi+1Eh]
jz	loc_444449
fld	dword ptr [esi+0Eh]
fmul	dword ptr flt_478754
push	0C1A00000h			; float
push	ecx
fstp	[esp+28h+var_28]		; float
fld	dword ptr [esi+0Ah]
fmul	dword ptr flt_478754
push	ecx
fstp	[esp+2Ch+var_2C]		; float
call	sub_43E450
add	esp, 0Ch
mov	[esi+14Eh], al
test	al, al
jz	loc_444449
push	0				; float
push	0				; int
push	edi				; int
call	sub_43FF60
mov	ax, [esi]
add	esp, 0Ch
cmp	ax, 0BAh
jz	short loc_444449
cmp	ax, 0BBh
jz	short loc_444449
push	1
call	sub_44E240
add	esp, 4
push	3E4CCCCDh			; alpha
push	0				; blue
push	0				; green
push	0				; red
call	ebx ; glColor4f
fld	dword ptr [esi+0Ah]
movsx	eax, word ptr [esi]
fst	[esp+20h+var_10]
fstp	[esp+20h+var_C]
fld	dword ptr [esi+0Eh]
lea	ecx, [eax+eax*2]
fst	[esp+20h+var_14]
mov	edx, [esp+20h+var_14]
fstp	[esp+20h+var_8]
shl	ecx, 3
sub	ecx, eax
mov	eax, [esp+20h+var_10]
push	edx				; float
push	eax				; float
lea	edi, byte_5729398[ecx*8]
call	sub_43C880
mov	ecx, [esp+28h+var_C]
mov	edx, [esp+28h+var_8]
fstp	dword ptr [edi+74h]
add	esp, 8
mov	[edi+6Ch], ecx
mov	ecx, edi
mov	[edi+70h], edx
push	0FFFFFFFFh
push	0FFFFFFFFh
call	sub_410870

loc_444449:				; CODE XREF: sub_444360+25j
					; sub_444360+5Aj ...
fld	dword ptr [esi+1Eh]
fsub	dword ptr flt_4786E8
add	esi, 178h
cmp	esi, (offset dword_81C1528+2)
fstp	dword ptr [esi-15Ah]
jl	loc_444371
pop	edi
pop	esi
pop	ebx
add	esp, 14h
retn
sub_444360 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_444480 proc	near			; CODE XREF: sub_455310+16Fp

var_40=	dword ptr -40h
var_24=	dword ptr -24h
var_20=	dword ptr -20h
var_1C=	dword ptr -1Ch
var_18=	dword ptr -18h
var_14=	dword ptr -14h
var_10=	dword ptr -10h
var_C= dword ptr -0Ch
var_8= dword ptr -8
var_4= dword ptr -4

sub	esp, 24h
mov	ecx, dword ptr dword_81C1528
push	ebx
push	ebp
push	esi
push	edi
mov	[esp+34h+var_24], 0
mov	esi, offset byte_81C0680

loc_44449A:				; CODE XREF: sub_444480+69Fj
cmp	ecx, 7
jz	short loc_4444AB
cmp	esi, offset byte_81C0AE8
jge	loc_444B0A

loc_4444AB:				; CODE XREF: sub_444480+1Dj
mov	al, [esi-8]
lea	edi, [esi-8]
test	al, al
jnz	loc_44481A
call	_rand
and	eax, 800003FFh
jns	short loc_4444CC
dec	eax
or	eax, 0FFFFFC00h
inc	eax

loc_4444CC:				; CODE XREF: sub_444480+43j
sub	eax, 200h
mov	[esp+34h+var_20], eax
mov	eax, dword ptr dword_79DBE88
fild	[esp+34h+var_20]
fadd	dword ptr [eax+0Ch]
fstp	dword ptr [esi+4]
call	_rand
and	eax, 800003FFh
jns	short loc_4444F7
dec	eax
or	eax, 0FFFFFC00h
inc	eax

loc_4444F7:				; CODE XREF: sub_444480+6Ej
sub	eax, 200h
mov	[esp+34h+var_20], eax
mov	eax, dword ptr dword_79DBE88
fild	[esp+34h+var_20]
fadd	dword ptr [eax+10h]
fstp	dword ptr [esi+8]
fld	dword ptr [esi+8]
fmul	dword ptr flt_478770
mov	ecx, [eax+14h]
mov	[esi+0Ch], ecx
call	__ftol
fld	dword ptr [esi+4]
fmul	dword ptr flt_478770
push	eax
call	__ftol
push	eax
call	sub_43BE00
mov	ecx, dword ptr dword_81C1528
add	esp, 8
test	ecx, ecx
jnz	short loc_444553
cmp	byte_7ED99EC[eax], 5
jz	short loc_444594
jmp	loc_444811
; ---------------------------------------------------------------------------

loc_444553:				; CODE XREF: sub_444480+C3j
cmp	ecx, 1
jnz	short loc_444566
cmp	byte_81AA364[eax], 8
jb	short loc_444594
jmp	loc_444811
; ---------------------------------------------------------------------------

loc_444566:				; CODE XREF: sub_444480+D6j
cmp	ecx, 6
jnz	short loc_444579
cmp	byte_81AA364[eax], 8
jb	short loc_444594
jmp	loc_444811
; ---------------------------------------------------------------------------

loc_444579:				; CODE XREF: sub_444480+E9j
cmp	ecx, 7
jnz	loc_444811
mov	al, byte_81AA364[eax]
test	al, al
jz	short loc_444594
cmp	al, 2
jnz	loc_444811

loc_444594:				; CODE XREF: sub_444480+CCj
					; sub_444480+DFj ...
mov	ebx, 3F800000h
or	ebp, 0FFFFFFFFh
test	ecx, ecx
mov	byte ptr [edi],	1
mov	dword ptr [esi+0C0h], 41500000h
mov	dword ptr [esi+150h], 0
mov	[esi+14Ch], ebx
mov	[esi+58h], ebp
jnz	short loc_444627
mov	word ptr [esi-6], 0B3h
call	_rand
and	eax, 80000001h
jns	short loc_4445D7
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_4445D7:				; CODE XREF: sub_444480+150j
add	eax, 2
mov	[esp+34h+var_20], eax
fild	[esp+34h+var_20]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+14Ch]
call	_rand
and	eax, 80000003h
jns	short loc_4445FF
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_4445FF:				; CODE XREF: sub_444480+178j
add	eax, 6
mov	[esp+34h+var_20], eax
fild	[esp+34h+var_20]

loc_44460A:				; CODE XREF: sub_444480+1CEj
					; sub_444480+1F7j
fmul	dword ptr flt_478700
fst	dword ptr [esi]
fld	dword ptr flt_4787DC
fdiv	st, st(1)
fstp	dword ptr [esi+0B4h]
fstp	st
jmp	loc_4447C1
; ---------------------------------------------------------------------------

loc_444627:				; CODE XREF: sub_444480+13Ej
cmp	ecx, 1
jnz	short loc_444650
mov	word ptr [esi-6], 0B1h
call	_rand
and	eax, 80000001h
jns	short loc_444643
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_444643:				; CODE XREF: sub_444480+1BCj
add	eax, 6
mov	[esp+34h+var_20], eax
fild	[esp+34h+var_20]
jmp	short loc_44460A
; ---------------------------------------------------------------------------

loc_444650:				; CODE XREF: sub_444480+1AAj
cmp	ecx, 6
jnz	short loc_444679
mov	word ptr [esi-6], 0B2h
call	_rand
and	eax, 80000001h
jns	short loc_44466C
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_44466C:				; CODE XREF: sub_444480+1E5j
add	eax, 6
mov	[esp+34h+var_20], eax
fild	[esp+34h+var_20]
jmp	short loc_44460A
; ---------------------------------------------------------------------------

loc_444679:				; CODE XREF: sub_444480+1D3j
cmp	ecx, 7
jnz	loc_4447C1
call	_rand
and	eax, 80000001h
jns	short loc_444693
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_444693:				; CODE XREF: sub_444480+20Cj
add	eax, 8
mov	edx, dword ptr dword_79DBE88
mov	[esp+34h+var_20], eax
fild	[esp+34h+var_20]
fmul	dword ptr flt_478700
fstp	dword ptr [esi]
fld	dword ptr [edx+10h]
fmul	dword ptr flt_478754
fcomp	dword ptr flt_47883C
fnstsw	ax
test	ah, 1
jz	short loc_444709
call	_rand
and	eax, 80000003h
jns	short loc_4446D3
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_4446D3:				; CODE XREF: sub_444480+24Cj
fld	dword ptr flt_4786B8
fdiv	dword ptr [esi]
add	eax, 0B6h
mov	[esi-6], ax
fstp	dword ptr [esi+0B4h]
call	_rand
and	eax, 80000001h
jns	short loc_4446FB
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_4446FB:				; CODE XREF: sub_444480+274j
jz	short loc_444762
mov	dword ptr [esi+0C0h], 40400000h
jmp	short loc_44476C
; ---------------------------------------------------------------------------

loc_444709:				; CODE XREF: sub_444480+240j
call	_rand
and	eax, 80000001h
jns	short loc_44471A
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_44471A:				; CODE XREF: sub_444480+293j
add	eax, 0BAh
cmp	ax, 0BAh
mov	[esi-6], ax
jz	short loc_44472F
cmp	ax, 0BBh
jnz	short loc_444739

loc_44472F:				; CODE XREF: sub_444480+2A7j
mov	dword ptr [esi+58h], 0
mov	[esi+5Ch], ebx

loc_444739:				; CODE XREF: sub_444480+2ADj
fld	dword ptr flt_4786E0
fdiv	dword ptr [esi]
fstp	dword ptr [esi+0B4h]
call	_rand
and	eax, 80000001h
jns	short loc_444758
dec	eax
or	eax, 0FFFFFFFEh
inc	eax

loc_444758:				; CODE XREF: sub_444480+2D1j
jnz	short loc_444762
mov	[esi+0C0h], ebx
jmp	short loc_44476C
; ---------------------------------------------------------------------------

loc_444762:				; CODE XREF: sub_444480:loc_4446FBj
					; sub_444480:loc_444758j
mov	dword ptr [esi+0C0h], 40000000h

loc_44476C:				; CODE XREF: sub_444480+287j
					; sub_444480+2E0j
call	_rand
and	eax, 8000001Fh
jns	short loc_44477D
dec	eax
or	eax, 0FFFFFFE0h
inc	eax

loc_44477D:				; CODE XREF: sub_444480+2F6j
mov	[esp+34h+var_20], eax
mov	eax, [esi+8]
fild	[esp+34h+var_20]
mov	ecx, [esi+4]
push	eax				; float
push	ecx				; float
fmul	dword ptr flt_478700
fstp	dword ptr [esi+6Ch]
call	sub_43C880
fstp	[esp+3Ch+var_1C]
add	esp, 8
call	_rand
cdq
mov	ecx, 96h
idiv	ecx
add	edx, 32h
mov	[esp+34h+var_20], edx
fild	[esp+34h+var_20]
fadd	[esp+34h+var_1C]
fstp	dword ptr [esi+0Ch]

loc_4447C1:				; CODE XREF: sub_444480+1A2j
					; sub_444480+1FCj
mov	eax, 3F000000h
mov	byte ptr [esi+0C4h], 1
mov	[esi+0D0h], eax
mov	[esi+0D4h], eax
mov	[esi+0D8h], eax
xor	eax, eax
mov	[esi+10h], eax
mov	[esi+14h], eax
mov	[esi+18h], eax
mov	byte ptr [esi+149h], 1
mov	[esi-4], eax
mov	[esi+4Ch], ebp
call	_rand
and	eax, 8000007Fh
jns	short loc_444808
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_444808:				; CODE XREF: sub_444480+381j
mov	ecx, dword ptr dword_81C1528
mov	[esi+54h], eax

loc_444811:				; CODE XREF: sub_444480+CEj
					; sub_444480+E1j ...
cmp	byte ptr [edi],	0
jz	loc_444B0A

loc_44481A:				; CODE XREF: sub_444480+33j
movsx	eax, word ptr [esi-6]
lea	ebx, [esi+10h]
lea	ebp, [esi+4]
lea	edx, [eax+eax*2]
push	ebx				; int
shl	edx, 3
sub	edx, eax
mov	al, [esi+0EDh]
push	ebp				; int
lea	ecx, byte_5729398[edx*8]
lea	edx, [esi+0EEh]
push	ecx
mov	[ecx+0A0h], al
lea	eax, [esi+0F4h]
fld	dword ptr [esi+0B4h]
fmul	dword ptr flt_4786E0
fstp	[esp+40h+var_40]		; float
push	edx				; int
lea	edx, [esi+0F0h]
push	eax				; int
push	edx				; int
call	sub_40FFA0
mov	ax, [esi-6]
cmp	ax, 0BAh
jz	short loc_44487B
cmp	ax, 0BBh
jnz	short loc_44489B

loc_44487B:				; CODE XREF: sub_444480+3F3j
fld	dword ptr [esi+6Ch]
fsin
fmul	dword ptr flt_47874C
fadd	dword ptr flt_4786E0
fstp	dword ptr [esi+5Ch]
fld	dword ptr [esi+6Ch]
fadd	dword ptr flt_478700
fstp	dword ptr [esi+6Ch]

loc_44489B:				; CODE XREF: sub_444480+3F9j
cmp	ax, 0B3h
jl	short loc_4448A7
cmp	ax, 0BDh
jle	short loc_4448B2

loc_4448A7:				; CODE XREF: sub_444480+41Fj
mov	ecx, [esi+54h]
test	ecx, ecx
jle	loc_444AB1

loc_4448B2:				; CODE XREF: sub_444480+425j
cmp	ax, 0B2h
jnz	short loc_4448BC
push	1
jmp	short loc_4448BE
; ---------------------------------------------------------------------------

loc_4448BC:				; CODE XREF: sub_444480+436j
push	0

loc_4448BE:				; CODE XREF: sub_444480+43Aj
push	edi
call	sub_40DC10
mov	eax, [esp+3Ch+var_24]
add	esp, 8
push	0Ah				; int
push	offset byte_81C0678		; float
push	eax				; float
push	edi				; float
call	sub_40DA70
lea	edi, [esi+78h]
push	edi
push	ebx
call	sub_43F530
call	_rand
and	eax, 80000003h
jns	short loc_4448F4
dec	eax
or	eax, 0FFFFFFFCh
inc	eax

loc_4448F4:				; CODE XREF: sub_444480+46Dj
add	eax, 6
lea	ecx, [esp+4Ch+var_18]
mov	[esp+4Ch+var_1C], eax
push	ecx
fild	[esp+50h+var_1C]
lea	edx, [esp+50h+var_C]
push	edi
push	edx
mov	[esp+58h+var_8], 0
fmul	dword ptr [esi+0B4h]
mov	[esp+58h+var_4], 0
fstp	[esp+58h+var_C]
call	sub_43F830
fld	[esp+58h+var_18]
fadd	dword ptr [ebp+0]
mov	eax, dword ptr dword_81C1528
mov	edi, 7
add	esp, 24h
cmp	eax, edi
fst	[esp+34h+var_20]
fstp	dword ptr [ebp+0]
fld	[esp+34h+var_14]
fadd	dword ptr [esi+8]
fst	[esp+34h+var_1C]
fstp	dword ptr [esi+8]
fld	[esp+34h+var_10]
fadd	dword ptr [esi+0Ch]
fstp	dword ptr [esi+0Ch]
jz	short loc_444975
mov	eax, [esp+34h+var_1C]
mov	ecx, [esp+34h+var_20]
push	eax				; float
push	ecx				; float
call	sub_43C880
fstp	dword ptr [esi+0Ch]
add	esp, 8

loc_444975:				; CODE XREF: sub_444480+4DEj
fld	[esp+34h+var_18]
fmul	dword ptr flt_478778
fadd	dword ptr [ebp+0]
fstp	dword ptr [esi+0A8h]
fld	[esp+34h+var_14]
fmul	dword ptr flt_478778
fadd	dword ptr [esi+8]
fstp	dword ptr [esi+0ACh]
fld	dword ptr [esi+8]
fmul	dword ptr flt_478770
call	__ftol
fld	dword ptr [ebp+0]
fmul	dword ptr flt_478770
push	eax
call	__ftol
push	eax
call	sub_43BE00
mov	cx, [esi-6]
add	esp, 8
cmp	cx, 0B3h
jnz	short loc_4449D5
cmp	byte_7ED99EC[eax], 5
jnz	short loc_4449FB

loc_4449D5:				; CODE XREF: sub_444480+54Aj
cmp	cx, 0B1h
jnz	short loc_4449E5
cmp	byte_81AA364[eax], 8
jnb	short loc_4449FB

loc_4449E5:				; CODE XREF: sub_444480+55Aj
cmp	dword ptr dword_81C1528, edi
jnz	short loc_444A2F
mov	al, byte_81AA364[eax]
cmp	al, 1
jz	short loc_4449FB
cmp	al, 8
jb	short loc_444A2F

loc_4449FB:				; CODE XREF: sub_444480+553j
					; sub_444480+563j ...
fld	dword ptr [esi+18h]
fadd	dword ptr flt_4786F0
fst	[esp+34h+var_20]
fstp	dword ptr [esi+18h]
fld	[esp+34h+var_20]
fcomp	dword ptr flt_4786FC
fnstsw	ax
test	ah, 1
jnz	short loc_444A29
fld	[esp+34h+var_20]
fsub	dword ptr flt_4786FC
fstp	dword ptr [esi+18h]

loc_444A29:				; CODE XREF: sub_444480+59Aj
mov	eax, [esi-4]
inc	eax
jmp	short loc_444A37
; ---------------------------------------------------------------------------

loc_444A2F:				; CODE XREF: sub_444480+56Bj
					; sub_444480+579j
mov	eax, [esi-4]
test	eax, eax
jle	short loc_444A3A
dec	eax

loc_444A37:				; CODE XREF: sub_444480+5ADj
mov	[esi-4], eax

loc_444A3A:				; CODE XREF: sub_444480+5B4j
cmp	dword ptr [esi-4], 2
jl	short loc_444A44
mov	byte ptr [esi-8], 0

loc_444A44:				; CODE XREF: sub_444480+5BEj
mov	eax, dword ptr dword_79DBE88
fld	dword ptr [ebp+0]
fsub	dword ptr [eax+0Ch]
fld	dword ptr [esi+8]
fsub	dword ptr [eax+10h]
fld	st
fmul	st, st(1)
fld	st(2)
fmul	st, st(3)
faddp	st(1), st
fsqrt
fstp	st(2)
fstp	st
fcom	dword ptr flt_478A38
fnstsw	ax
test	ah, 1
jnz	short loc_444A76
mov	byte ptr [esi-8], 0

loc_444A76:				; CODE XREF: sub_444480+5F0j
fcomp	dword ptr flt_4788AC
fnstsw	ax
test	ah, 1
jz	short loc_444ABC
cmp	cx, 0B1h
jnz	short loc_444ABC
call	_rand
and	eax, 800000FFh
jns	short loc_444A9D
dec	eax
or	eax, 0FFFFFF00h
inc	eax

loc_444A9D:				; CODE XREF: sub_444480+614j
jnz	short loc_444ABC
lea	eax, [esi-8]
push	0
push	eax
push	0Fh
call	sub_401570
add	esp, 0Ch
jmp	short loc_444ABC
; ---------------------------------------------------------------------------

loc_444AB1:				; CODE XREF: sub_444480+42Cj
push	0
push	edi
call	sub_40DC10
add	esp, 8

loc_444ABC:				; CODE XREF: sub_444480+601j
					; sub_444480+608j ...
mov	ecx, [esi+54h]
dec	ecx
mov	eax, ecx
mov	[esi+54h], ecx
test	eax, eax
jg	short loc_444AF8
cmp	word ptr [esi-6], 0B2h
jz	short loc_444AF8
call	_rand
and	eax, 8000003Fh
jns	short loc_444AE2
dec	eax
or	eax, 0FFFFFFC0h
inc	eax

loc_444AE2:				; CODE XREF: sub_444480+65Bj
jnz	short loc_444AF8
call	_rand
and	eax, 8000007Fh
jns	short loc_444AF5
dec	eax
or	eax, 0FFFFFF80h
inc	eax

loc_444AF5:				; CODE XREF: sub_444480+66Ej
mov	[esi+54h], eax

loc_444AF8:				; CODE XREF: sub_444480+647j
					; sub_444480+64Fj ...
lea	eax, [esi-8]
push	eax
call	sub_40D9B0
mov	ecx, dword ptr dword_81C1528
add	esp, 4

loc_444B0A:				; CODE XREF: sub_444480+25j
					; sub_444480+394j
mov	edi, [esp+34h+var_24]
add	esi, 178h
inc	edi
cmp	esi, offset byte_81C1530
mov	[esp+34h+var_24], edi
jl	loc_44449A
pop	edi
pop	esi
pop	ebp
pop	ebx
add	esp, 24h
retn
sub_444480 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_444B30 proc	near			; CODE XREF: sub_407C30:loc_407D76p
					; sub_408540:loc_4085F8p ...
mov	eax, offset byte_7C41E10

loc_444B35:				; CODE XREF: sub_444B30+12j
mov	byte ptr [eax],	0
add	eax, 1C0h
cmp	eax, offset byte_7CAF410
jl	short loc_444B35
retn
sub_444B30 endp

; ---------------------------------------------------------------------------
align 10h

; =============== S U B	R O U T	I N E =======================================


sub_444B50 proc	near			; CODE XREF: sub_416740+69p
					; sub_435B10+4ACp ...

arg_0= dword ptr  4

push	esi
mov	esi, [esp+4+arg_0]
or	ecx, 0FFFFFFFFh
mov	eax, 3E99999Ah
mov	[esi+60h], ecx
mov	[esi+54h], ecx
mov	cx, [esi+2]
mov	[esi+0D8h], eax
mov	[esi+0DCh], eax
mov	[esi+0E0h], eax
mov	edx, 1
xor	eax, eax
cmp	cx, 18Eh
push	edi
mov	[esi+0CCh], dl
mov	[esi+151h], al
mov	[esi+7Ch], al
mov	[esi+0BCh], eax
mov	dword ptr [esi+0C0h], 42480000h
mov	[esi+0FCh], eax
mov	[esi+0F8h], eax
mov	[esi+0F6h], al
mov	[esi+0F5h], al
mov	[esi+0C8h], eax
mov	dword ptr [esi+158h], 3F800000h
mov	dword ptr [esi+64h], 3F800000h
mov	[esi+68h], eax
mov	[esi+6Ch], eax
mov	dword ptr [esi+8], 3F4CCCCDh
mov	[esi+71h], al
jl	short loc_444BF4
cmp	cx, 1BEh
jge	short loc_444BF4
mov	dword ptr [esi+8], 3F333333h

loc_444BF4:				; CODE XREF: sub_444B50+94j
					; sub_444B50+9Bj
movsx	ecx, cx
lea	edi, [ecx-163h]			; switch 236 cases
cmp	edi, 0EBh
ja	loc_444D87			; jumptable 00444C11 default case
xor	ecx, ecx
mov	cl, ds:byte_444DC4[edi]
jmp	ds:off_444D8C[ecx*4]		; switch jump
; ---------------------------------------------------------------------------

loc_444C18:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], edx			; jumptable 00444C11 case 437
call	_rand
cdq
mov	ecx, 0Bh
pop	edi
idiv	ecx
mov	[esp+4+arg_0], edx
fild	[esp+4+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+64h]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444C3C:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	dword ptr [esi+60h], 0FFFFFFFEh	; jumptable 00444C11 cases 420,427,428,436
jmp	loc_444D6A
; ---------------------------------------------------------------------------

loc_444C48:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], edx			; jumptable 00444C11 case 386
pop	edi

loc_444C4C:				; DATA XREF: .data:00484ACCo
fld	dword ptr flt_5727448
fmul	dword ptr flt_4786B0
fsin
fmul	dword ptr flt_47870C
fadd	dword ptr flt_478750
fstp	dword ptr [esi+64h]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444C6B:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
fld	dword ptr flt_5727448			; jumptable 00444C11 case 407
call	__ftol
cdq
mov	ecx, 7D0h
pop	edi
idiv	ecx
mov	[esp+4+arg_0], edx
fild	[esp+4+arg_0]
fmul	dword ptr flt_4787BC
fstp	dword ptr [esi+6Ch]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444C92:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], edx			; jumptable 00444C11 case 460
call	_rand
cdq
mov	ecx, 0Ah
idiv	ecx
mov	[esp+8+arg_0], edx
fild	[esp+8+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+68h]
call	_rand
cdq
mov	ecx, 0Ah
pop	edi
idiv	ecx
mov	[esp+4+arg_0], edx
fild	[esp+4+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+6Ch]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444CD4:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	dword ptr [esi+60h], 2		; jumptable 00444C11 case 435
call	_rand
cdq
mov	ecx, 0Ah
idiv	ecx
mov	[esp+8+arg_0], edx
fild	[esp+8+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+68h]
call	_rand
cdq
mov	ecx, 0Ah
pop	edi
idiv	ecx
mov	[esp+4+arg_0], edx
fild	[esp+4+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+6Ch]
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444D1A:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	dword ptr [esi+8], 3F333333h	; jumptable 00444C11 case 590
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444D24:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	dword ptr [esi+8], 3F800000h	; jumptable 00444C11 case 575
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444D2E:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], edx			; jumptable 00444C11 case 364
call	_rand
cdq
mov	ecx, 0Ah
idiv	ecx
mov	[esp+8+arg_0], edx
fild	[esp+8+arg_0]
fmul	dword ptr flt_478700
fstp	dword ptr [esi+68h]
jmp	short loc_444D6A
; ---------------------------------------------------------------------------

loc_444D51:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	dword ptr [esi+60h], 2		; jumptable 00444C11 case 430
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444D5B:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], edx			; jumptable 00444C11 cases 355,363,558
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444D61:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], eax			; jumptable 00444C11 cases 387,542,550-553
pop	edi
pop	esi
retn
; ---------------------------------------------------------------------------

loc_444D67:				; CODE XREF: sub_444B50+C1j
					; DATA XREF: .text:off_444D8Co
mov	[esi+60h], edx			; jumptable 00444C11 cases 360,388,398,457-459

loc_444D6A:				; CODE XREF: sub_444B50+F3j
					; sub_444B50+1FFj
fld	dword ptr flt_5727448
fmul	dword ptr flt_4786B0
fsin
fmul	dword ptr flt_478758
fadd	dword ptr flt_4787E4
fstp	dword ptr [esi+64h]

loc_444D87:				; CODE XREF: sub_444B50+B3j
					; sub_444B50+C1j
					; DATA XREF: ...
pop	edi				; jumptable 00444C11 default case
pop	esi
retn
; ---------------------------------------------------------------------------
align 4
off_444D8C dd offset loc_444D5B, offset	loc_444D67, offset loc_444D2E, offset loc_444C48
					; DATA XREF: sub_444B50+C1r
dd offset loc_444D61, offset loc_444C6B, offset	loc_444C3C, offset loc_444D51 ;	jump table for switch statement
dd offset loc_444CD4, offset loc_444C18, offset	loc_444C92, offset loc_444D24
dd offset loc_444D1A, offset loc_444D87
byte_444DC4 db 0, 0Dh, 0Dh, 0Dh, 0Dh, 1, 0Dh, 0Dh, 0, 2, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh
					; DATA XREF: sub_444B50+BBr
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh	; indirect table for switch statement
db 0Dh,	3, 4, 1, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 1, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 5, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 6, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 6,	6, 0Dh
db 7, 0Dh, 0Dh,	0Dh, 0Dh, 8, 6,	9, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 1, 1,	1, 0Ah
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 4, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 4, 4, 4, 4,	0Dh, 0Dh, 0Dh, 0Dh, 0, 0Dh, 0Dh
db 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Bh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh, 0Dh,	0Dh, 0Dh, 0Dh, 0Dh, 0Dh
db 0Dh,	0Ch
sub_444B50 endp



end